From 7072a1586789b58e99ea3f3ad2609201f57abe66 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 22 Feb 2023 05:31:31 +0000 Subject: [PATCH] CodeGen from PR 22639 in Azure/azure-rest-api-specs Networking 2022-09-01 release (#22639) * Adds base for updating Microsoft.Network from version stable/2022-07-01 to version 2022-09-01 * Updates readme * Updates API version in new specs and examples * Added flowlog property in virtual network (#21790) Co-authored-by: Krishna Mishra * commit1 (#22111) Co-authored-by: Khushboo Baheti * adding auth status property to circuit (#22024) * Make auth status readonly (#22365) * make auth status read only * fixing model validation * prettier fix * Add support for State flag in Custom Rule (#22457) * Fix LRO header model validation (#22506) * Add new status code for application gateway custom error page (#22151) * Add new status code for application gateway custom error page * Fix prettier * Adding words to Custom-Words list * Fix missing resource id in application gateway list example (#22509) * Resolving merge conflicts with main branch --------- Co-authored-by: Mikhail Co-authored-by: KRISHNA MISHRA Co-authored-by: Krishna Mishra Co-authored-by: Khushboo Baheti <37917868+Khushboo-Baheti@users.noreply.github.com> Co-authored-by: Khushboo Baheti Co-authored-by: utbarn-ms <66377251+utbarn-ms@users.noreply.github.com> Co-authored-by: tejasshah7 <49326906+tejasshah7@users.noreply.github.com> Co-authored-by: Prateek Sachan <42961174+prateek2211@users.noreply.github.com> --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 20124 ++++++++++++++++ .../pom.xml | 61 + .../network/generated/NetworkManager.java | 2436 ++ .../fluent/AdminRuleCollectionsClient.java | 219 + .../generated/fluent/AdminRulesClient.java | 245 + ...tewayPrivateEndpointConnectionsClient.java | 226 + ...tionGatewayPrivateLinkResourcesClient.java | 48 + ...ationGatewayWafDynamicManifestsClient.java | 42 + ...ewayWafDynamicManifestsDefaultsClient.java | 42 + .../fluent/ApplicationGatewaysClient.java | 660 + .../ApplicationSecurityGroupsClient.java | 245 + .../fluent/AvailableDelegationsClient.java | 41 + .../AvailableEndpointServicesClient.java | 41 + .../AvailablePrivateEndpointTypesClient.java | 67 + ...ailableResourceGroupDelegationsClient.java | 45 + .../fluent/AvailableServiceAliasesClient.java | 71 + .../fluent/AzureFirewallFqdnTagsClient.java | 36 + .../fluent/AzureFirewallsClient.java | 325 + .../generated/fluent/BastionHostsClient.java | 267 + .../fluent/BgpServiceCommunitiesClient.java | 36 + .../ConfigurationPolicyGroupsClient.java | 233 + .../fluent/ConnectionMonitorsClient.java | 435 + .../ConnectivityConfigurationsClient.java | 195 + .../fluent/CustomIpPrefixesClient.java | 239 + .../fluent/DdosCustomPoliciesClient.java | 190 + .../fluent/DdosProtectionPlansClient.java | 238 + .../fluent/DefaultSecurityRulesClient.java | 72 + .../fluent/DscpConfigurationsClient.java | 209 + ...pressRouteCircuitAuthorizationsClient.java | 221 + .../ExpressRouteCircuitConnectionsClient.java | 241 + .../ExpressRouteCircuitPeeringsClient.java | 211 + .../fluent/ExpressRouteCircuitsClient.java | 515 + .../fluent/ExpressRouteConnectionsClient.java | 213 + ...essRouteCrossConnectionPeeringsClient.java | 222 + .../ExpressRouteCrossConnectionsClient.java | 434 + .../fluent/ExpressRouteGatewaysClient.java | 290 + .../fluent/ExpressRouteLinksClient.java | 72 + .../ExpressRoutePortAuthorizationsClient.java | 218 + .../fluent/ExpressRoutePortsClient.java | 274 + .../ExpressRoutePortsLocationsClient.java | 66 + ...ressRouteProviderPortsLocationsClient.java | 39 + .../ExpressRouteServiceProvidersClient.java | 36 + .../fluent/FirewallPoliciesClient.java | 239 + .../FirewallPolicyIdpsSignaturesClient.java | 45 + ...olicyIdpsSignaturesFilterValuesClient.java | 52 + ...llPolicyIdpsSignaturesOverridesClient.java | 136 + ...ewallPolicyRuleCollectionGroupsClient.java | 220 + .../generated/fluent/FlowLogsClient.java | 244 + .../fluent/HubRouteTablesClient.java | 214 + .../HubVirtualNetworkConnectionsClient.java | 219 + .../fluent/InboundNatRulesClient.java | 213 + .../InboundSecurityRuleOperationsClient.java | 99 + .../generated/fluent/IpAllocationsClient.java | 237 + .../generated/fluent/IpGroupsClient.java | 254 + ...LoadBalancerBackendAddressPoolsClient.java | 212 + ...alancerFrontendIpConfigurationsClient.java | 77 + .../LoadBalancerLoadBalancingRulesClient.java | 72 + .../LoadBalancerNetworkInterfacesClient.java | 41 + .../LoadBalancerOutboundRulesClient.java | 72 + .../fluent/LoadBalancerProbesClient.java | 72 + .../generated/fluent/LoadBalancersClient.java | 376 + .../fluent/LocalNetworkGatewaysClient.java | 217 + ...tGroupNetworkManagerConnectionsClient.java | 137 + .../generated/fluent/NatGatewaysClient.java | 237 + .../generated/fluent/NatRulesClient.java | 208 + .../generated/fluent/NetworkGroupsClient.java | 184 + ...etworkInterfaceIpConfigurationsClient.java | 76 + .../NetworkInterfaceLoadBalancersClient.java | 41 + ...tworkInterfaceTapConfigurationsClient.java | 218 + .../fluent/NetworkInterfacesClient.java | 653 + .../fluent/NetworkManagementClient.java | 957 + .../fluent/NetworkManagerCommitsClient.java | 77 + ...nagerDeploymentStatusOperationsClient.java | 55 + .../fluent/NetworkManagersClient.java | 222 + .../fluent/NetworkProfilesClient.java | 208 + .../fluent/NetworkSecurityGroupsClient.java | 246 + .../NetworkVirtualAppliancesClient.java | 248 + .../fluent/NetworkWatchersClient.java | 997 + .../generated/fluent/OperationsClient.java | 36 + .../fluent/P2SVpnGatewaysClient.java | 581 + .../fluent/PacketCapturesClient.java | 328 + ...rExpressRouteCircuitConnectionsClient.java | 84 + .../fluent/PrivateDnsZoneGroupsClient.java | 214 + .../fluent/PrivateEndpointsClient.java | 222 + .../fluent/PrivateLinkServicesClient.java | 594 + .../fluent/PublicIpAddressesClient.java | 553 + .../fluent/PublicIpPrefixesClient.java | 239 + .../fluent/ResourceNavigationLinksClient.java | 44 + .../fluent/ResourceProvidersClient.java | 522 + .../fluent/RouteFilterRulesClient.java | 212 + .../generated/fluent/RouteFiltersClient.java | 238 + .../generated/fluent/RouteMapsClient.java | 208 + .../generated/fluent/RouteTablesClient.java | 237 + .../generated/fluent/RoutesClient.java | 197 + .../fluent/RoutingIntentsClient.java | 214 + .../fluent/ScopeConnectionsClient.java | 147 + .../SecurityAdminConfigurationsClient.java | 183 + .../SecurityPartnerProvidersClient.java | 247 + .../generated/fluent/SecurityRulesClient.java | 212 + .../fluent/ServiceAssociationLinksClient.java | 44 + .../fluent/ServiceEndpointPoliciesClient.java | 246 + ...erviceEndpointPolicyDefinitionsClient.java | 236 + .../fluent/ServiceTagInformationsClient.java | 48 + .../generated/fluent/ServiceTagsClient.java | 43 + .../generated/fluent/StaticMembersClient.java | 171 + .../generated/fluent/SubnetsClient.java | 373 + ...iptionNetworkManagerConnectionsClient.java | 123 + .../generated/fluent/UsagesClient.java | 39 + .../generated/fluent/VipSwapsClient.java | 138 + .../fluent/VirtualApplianceSitesClient.java | 215 + .../fluent/VirtualApplianceSkusClient.java | 64 + .../VirtualHubBgpConnectionsClient.java | 329 + .../VirtualHubIpConfigurationsClient.java | 210 + .../fluent/VirtualHubRouteTableV2SClient.java | 224 + .../generated/fluent/VirtualHubsClient.java | 441 + ...irtualNetworkGatewayConnectionsClient.java | 719 + .../VirtualNetworkGatewayNatRulesClient.java | 217 + .../fluent/VirtualNetworkGatewaysClient.java | 1255 + .../fluent/VirtualNetworkPeeringsClient.java | 225 + .../fluent/VirtualNetworkTapsClient.java | 236 + .../fluent/VirtualNetworksClient.java | 336 + .../fluent/VirtualRouterPeeringsClient.java | 218 + .../fluent/VirtualRoutersClient.java | 221 + .../generated/fluent/VirtualWansClient.java | 236 + .../fluent/VpnConnectionsClient.java | 359 + .../generated/fluent/VpnGatewaysClient.java | 454 + .../fluent/VpnLinkConnectionsClient.java | 194 + ...ationsAssociatedWithVirtualWansClient.java | 74 + .../fluent/VpnServerConfigurationsClient.java | 256 + .../fluent/VpnSiteLinkConnectionsClient.java | 51 + .../generated/fluent/VpnSiteLinksClient.java | 72 + .../generated/fluent/VpnSitesClient.java | 236 + .../fluent/VpnSitesConfigurationsClient.java | 74 + .../WebApplicationFirewallPoliciesClient.java | 177 + .../generated/fluent/WebCategoriesClient.java | 63 + ...ectivityConfigurationsListResultInner.java | 87 + ...tiveSecurityAdminRulesListResultInner.java | 87 + .../fluent/models/AdminPropertiesFormat.java | 308 + .../models/AdminRuleCollectionInner.java | 119 + .../AdminRuleCollectionPropertiesFormat.java | 106 + ...enticationCertificatePropertiesFormat.java | 66 + ...cationGatewayAvailableSslOptionsInner.java | 183 + ...ayAvailableSslOptionsPropertiesFormat.java | 137 + ...atewayAvailableWafRuleSetsResultInner.java | 55 + ...wayBackendAddressPoolPropertiesFormat.java | 90 + .../ApplicationGatewayBackendHealthInner.java | 56 + ...tionGatewayBackendHealthOnDemandInner.java | 86 + ...cationGatewayBackendHealthServerInner.java | 133 + ...ayBackendHttpSettingsPropertiesFormat.java | 401 + ...atewayBackendSettingsPropertiesFormat.java | 233 + ...atewayFirewallRuleSetPropertiesFormat.java | 175 + ...ontendIpConfigurationPropertiesFormat.java | 174 + ...onGatewayFrontendPortPropertiesFormat.java | 66 + ...onGatewayHttpListenerPropertiesFormat.java | 312 + .../models/ApplicationGatewayInner.java | 1010 + ...atewayIpConfigurationPropertiesFormat.java | 69 + ...cationGatewayListenerPropertiesFormat.java | 172 + ...oadDistributionPolicyPropertiesFormat.java | 100 + ...oadDistributionTargetPropertiesFormat.java | 78 + ...cationGatewayPathRulePropertiesFormat.java | 224 + ...GatewayPrivateEndpointConnectionInner.java | 162 + ...vateEndpointConnectionPropertiesInner.java | 107 + ...wayPrivateLinkConfigurationProperties.java | 72 + ...yPrivateLinkIpConfigurationProperties.java | 148 + ...cationGatewayPrivateLinkResourceInner.java | 148 + ...nGatewayPrivateLinkResourceProperties.java | 81 + ...plicationGatewayProbePropertiesFormat.java | 354 + .../ApplicationGatewayPropertiesFormat.java | 1100 + ...RedirectConfigurationPropertiesFormat.java | 237 + ...wayRequestRoutingRulePropertiesFormat.java | 280 + ...GatewayRewriteRuleSetPropertiesFormat.java | 72 + ...ionGatewayRoutingRulePropertiesFormat.java | 173 + ...GatewaySslCertificatePropertiesFormat.java | 136 + ...cationGatewaySslPredefinedPolicyInner.java | 127 + ...aySslPredefinedPolicyPropertiesFormat.java | 81 + ...tionGatewaySslProfilePropertiesFormat.java | 134 + ...stedClientCertificatePropertiesFormat.java | 96 + ...rustedRootCertificatePropertiesFormat.java | 94 + ...tionGatewayUrlPathMapPropertiesFormat.java | 206 + ...wayWafDynamicManifestPropertiesResult.java | 120 + ...nGatewayWafDynamicManifestResultInner.java | 170 + .../models/ApplicationSecurityGroupInner.java | 120 + ...licationSecurityGroupPropertiesFormat.java | 58 + .../models/AuthorizationPropertiesFormat.java | 93 + .../AutoApprovedPrivateLinkServiceInner.java | 50 + .../models/AvailableDelegationInner.java | 155 + .../AvailablePrivateEndpointTypeInner.java | 154 + .../models/AvailableProvidersListInner.java | 63 + .../models/AvailableServiceAliasInner.java | 128 + ...icationRuleCollectionPropertiesFormat.java | 127 + .../models/AzureFirewallFqdnTagInner.java | 118 + .../AzureFirewallFqdnTagPropertiesFormat.java | 55 + .../fluent/models/AzureFirewallInner.java | 409 + ...rewallIpConfigurationPropertiesFormat.java | 114 + ...reFirewallNatRuleCollectionProperties.java | 127 + ...NetworkRuleCollectionPropertiesFormat.java | 127 + .../models/AzureFirewallPropertiesFormat.java | 382 + .../models/AzureReachabilityReportInner.java | 132 + .../fluent/models/AzureWebCategoryInner.java | 122 + .../AzureWebCategoryPropertiesFormat.java | 39 + ...ddressInboundNatRulePortMappingsInner.java | 56 + .../models/BackendAddressPoolInner.java | 286 + .../BackendAddressPoolPropertiesFormat.java | 263 + .../fluent/models/BaseAdminRuleInner.java | 58 + .../models/BastionActiveSessionInner.java | 190 + .../fluent/models/BastionHostInner.java | 325 + ...onHostIpConfigurationPropertiesFormat.java | 137 + .../models/BastionHostPropertiesFormat.java | 253 + .../models/BastionSessionStateInner.java | 69 + .../models/BastionShareableLinkInner.java | 107 + .../fluent/models/BgpConnectionInner.java | 195 + .../models/BgpConnectionProperties.java | 135 + .../models/BgpPeerStatusListResultInner.java | 55 + .../models/BgpServiceCommunityInner.java | 132 + .../BgpServiceCommunityPropertiesFormat.java | 81 + .../models/ConnectionMonitorParameters.java | 284 + .../ConnectionMonitorQueryResultInner.java | 82 + .../models/ConnectionMonitorResultInner.java | 327 + .../ConnectionMonitorResultProperties.java | 160 + .../models/ConnectionResetSharedKeyInner.java | 50 + .../models/ConnectionSharedKeyInner.java | 66 + .../ConnectivityConfigurationInner.java | 215 + .../ConnectivityConfigurationProperties.java | 222 + .../models/ConnectivityInformationInner.java | 135 + ...nterfaceConfigurationPropertiesFormat.java | 102 + ...erfaceIpConfigurationPropertiesFormat.java | 41 + ...ainerNetworkInterfacePropertiesFormat.java | 110 + .../fluent/models/CustomIpPrefixInner.java | 438 + .../CustomIpPrefixPropertiesFormat.java | 365 + .../fluent/models/DdosCustomPolicyInner.java | 120 + .../DdosCustomPolicyPropertiesFormat.java | 58 + .../models/DdosProtectionPlanInner.java | 116 + .../DdosProtectionPlanPropertiesFormat.java | 92 + .../models/DefaultAdminPropertiesFormat.java | 215 + .../models/DefaultRuleSetPropertyFormat.java | 76 + .../DnsNameAvailabilityResultInner.java | 50 + .../fluent/models/DscpConfigurationInner.java | 302 + .../DscpConfigurationPropertiesFormat.java | 290 + ...veNetworkSecurityGroupListResultInner.java | 70 + .../models/EffectiveRouteListResultInner.java | 70 + .../models/EndpointServiceResultInner.java | 62 + ...ExpressRouteCircuitAuthorizationInner.java | 166 + .../ExpressRouteCircuitConnectionInner.java | 252 + ...outeCircuitConnectionPropertiesFormat.java | 200 + .../models/ExpressRouteCircuitInner.java | 466 + .../ExpressRouteCircuitPeeringInner.java | 538 + ...teCircuitPeeringPropertiesFormatInner.java | 546 + .../ExpressRouteCircuitPropertiesFormat.java | 428 + .../models/ExpressRouteCircuitStatsInner.java | 128 + ...sRouteCircuitsArpTableListResultInner.java | 81 + ...uteCircuitsRoutesTableListResultInner.java | 81 + ...uitsRoutesTableSummaryListResultInner.java | 82 + .../models/ExpressRouteConnectionInner.java | 263 + .../ExpressRouteConnectionListInner.java | 54 + .../ExpressRouteConnectionProperties.java | 245 + .../ExpressRouteCrossConnectionInner.java | 252 + ...pressRouteCrossConnectionPeeringInner.java | 376 + ...RouteCrossConnectionPeeringProperties.java | 374 + ...ExpressRouteCrossConnectionProperties.java | 232 + ...ionsRoutesTableSummaryListResultInner.java | 71 + .../models/ExpressRouteGatewayInner.java | 208 + .../models/ExpressRouteGatewayListInner.java | 54 + .../models/ExpressRouteGatewayProperties.java | 168 + .../fluent/models/ExpressRouteLinkInner.java | 216 + .../ExpressRouteLinkPropertiesFormat.java | 198 + .../ExpressRoutePortAuthorizationInner.java | 154 + ...outePortAuthorizationPropertiesFormat.java | 90 + .../fluent/models/ExpressRoutePortInner.java | 327 + .../ExpressRoutePortPropertiesFormat.java | 280 + .../ExpressRoutePortsLocationInner.java | 146 + ...essRoutePortsLocationPropertiesFormat.java | 106 + .../models/ExpressRouteProviderPortInner.java | 241 + ...pressRouteProviderPortListResultInner.java | 69 + .../ExpressRouteProviderPortProperties.java | 199 + .../ExpressRouteServiceProviderInner.java | 143 + ...sRouteServiceProviderPropertiesFormat.java | 98 + .../fluent/models/FirewallPolicyInner.java | 431 + .../FirewallPolicyPropertiesFormat.java | 411 + ...irewallPolicyRuleCollectionGroupInner.java | 167 + ...llPolicyRuleCollectionGroupProperties.java | 98 + .../models/FlowLogInformationInner.java | 209 + .../generated/fluent/models/FlowLogInner.java | 259 + .../fluent/models/FlowLogProperties.java | 144 + .../models/FlowLogPropertiesFormat.java | 239 + .../models/FrontendIpConfigurationInner.java | 349 + ...dIpConfigurationPropertiesFormatInner.java | 295 + .../models/GatewayRouteListResultInner.java | 55 + ...nerateExpressRoutePortsLoaResultInner.java | 50 + .../fluent/models/HopLinkProperties.java | 69 + .../models/HubIpConfigurationInner.java | 209 + ...bIpConfigurationPropertiesFormatInner.java | 152 + .../fluent/models/HubRouteTableInner.java | 184 + .../models/HubRouteTableProperties.java | 127 + .../HubVirtualNetworkConnectionInner.java | 222 + ...HubVirtualNetworkConnectionProperties.java | 178 + .../InboundNatPoolPropertiesFormat.java | 279 + .../fluent/models/InboundNatRuleInner.java | 378 + .../InboundNatRulePropertiesFormatInner.java | 349 + .../models/InboundSecurityRuleInner.java | 141 + .../models/InboundSecurityRuleProperties.java | 71 + .../IpAddressAvailabilityResultInner.java | 105 + .../fluent/models/IpAllocationInner.java | 258 + .../models/IpAllocationPropertiesFormat.java | 216 + .../fluent/models/IpConfigurationInner.java | 196 + .../models/IpConfigurationProfileInner.java | 141 + ...igurationProfilePropertiesFormatInner.java | 71 + .../IpConfigurationPropertiesFormatInner.java | 152 + .../generated/fluent/models/IpGroupInner.java | 153 + .../models/IpGroupPropertiesFormat.java | 99 + .../fluent/models/IpPrefixesListInner.java | 51 + ...alancerBackendAddressPropertiesFormat.java | 199 + .../fluent/models/LoadBalancerInner.java | 359 + .../models/LoadBalancerPropertiesFormat.java | 287 + ...uestFrontendIpConfigurationProperties.java | 52 + .../fluent/models/LoadBalancingRuleInner.java | 414 + .../LoadBalancingRulePropertiesFormat.java | 388 + .../models/LocalNetworkGatewayInner.java | 220 + .../LocalNetworkGatewayPropertiesFormat.java | 167 + .../fluent/models/NatGatewayInner.java | 254 + .../models/NatGatewayPropertiesFormat.java | 150 + ...kConfigurationDiagnosticResponseInner.java | 44 + .../fluent/models/NetworkGroupInner.java | 94 + .../fluent/models/NetworkGroupProperties.java | 66 + .../fluent/models/NetworkInterfaceInner.java | 483 + .../NetworkInterfaceIpConfigurationInner.java | 429 + ...eIpConfigurationPropertiesFormatInner.java | 410 + ...NetworkInterfacePropertiesFormatInner.java | 492 + ...NetworkInterfaceTapConfigurationInner.java | 141 + ...TapConfigurationPropertiesFormatInner.java | 70 + .../models/NetworkManagerCommitInner.java | 134 + .../models/NetworkManagerConnectionInner.java | 117 + .../NetworkManagerConnectionProperties.java | 92 + ...anagerDeploymentStatusListResultInner.java | 84 + ...nectivityConfigurationListResultInner.java | 88 + ...tiveSecurityAdminRulesListResultInner.java | 88 + .../fluent/models/NetworkManagerInner.java | 198 + .../models/NetworkManagerProperties.java | 140 + .../fluent/models/NetworkProfileInner.java | 156 + .../NetworkProfilePropertiesFormat.java | 108 + .../models/NetworkSecurityGroupInner.java | 203 + .../NetworkSecurityGroupPropertiesFormat.java | 186 + .../models/NetworkVirtualApplianceInner.java | 400 + ...tworkVirtualAppliancePropertiesFormat.java | 372 + .../NetworkVirtualApplianceSkuInner.java | 151 + ...rkVirtualApplianceSkuPropertiesFormat.java | 90 + .../fluent/models/NetworkWatcherInner.java | 109 + .../NetworkWatcherPropertiesFormat.java | 40 + .../fluent/models/NextHopResultInner.java | 108 + .../fluent/models/OperationInner.java | 148 + .../models/OperationPropertiesFormat.java | 55 + .../fluent/models/OutboundRuleInner.java | 263 + .../models/OutboundRulePropertiesFormat.java | 225 + .../P2SConnectionConfigurationProperties.java | 169 + .../models/P2SVpnConnectionHealthInner.java | 52 + .../fluent/models/P2SVpnGatewayInner.java | 263 + .../models/P2SVpnGatewayProperties.java | 224 + .../models/PacketCaptureParameters.java | 264 + .../PacketCaptureQueryStatusResultInner.java | 184 + .../models/PacketCaptureResultInner.java | 290 + .../models/PacketCaptureResultProperties.java | 103 + ...eerExpressRouteCircuitConnectionInner.java | 251 + ...outeCircuitConnectionPropertiesFormat.java | 195 + .../fluent/models/PeerRouteListInner.java | 55 + .../models/PrivateDnsZoneGroupInner.java | 130 + .../PrivateDnsZoneGroupPropertiesFormat.java | 74 + .../PrivateDnsZonePropertiesFormat.java | 71 + .../PrivateEndpointConnectionInner.java | 163 + ...vateEndpointConnectionPropertiesInner.java | 106 + .../fluent/models/PrivateEndpointInner.java | 327 + ...vateEndpointIpConfigurationProperties.java | 106 + .../PrivateEndpointPropertiesInner.java | 278 + ...rivateLinkServiceConnectionProperties.java | 156 + .../models/PrivateLinkServiceInner.java | 311 + ...rivateLinkServiceIpConfigurationInner.java | 234 + ...ServiceIpConfigurationPropertiesInner.java | 177 + .../models/PrivateLinkServiceProperties.java | 267 + .../PrivateLinkServiceVisibilityInner.java | 50 + .../generated/fluent/models/ProbeInner.java | 288 + .../fluent/models/ProbePropertiesFormat.java | 251 + .../fluent/models/PublicIpAddressInner.java | 523 + .../PublicIpAddressPropertiesFormatInner.java | 440 + ...blicIpDdosProtectionStatusResultInner.java | 131 + .../fluent/models/PublicIpPrefixInner.java | 354 + .../PublicIpPrefixPropertiesFormatInner.java | 245 + .../fluent/models/QueryResultsInner.java | 81 + .../models/ResourceNavigationLinkFormat.java | 92 + ...esourceNavigationLinksListResultInner.java | 70 + .../fluent/models/RouteFilterInner.java | 151 + .../models/RouteFilterPropertiesFormat.java | 106 + .../fluent/models/RouteFilterRuleInner.java | 203 + .../RouteFilterRulePropertiesFormat.java | 144 + .../generated/fluent/models/RouteInner.java | 226 + .../fluent/models/RouteMapInner.java | 181 + .../fluent/models/RouteMapProperties.java | 127 + .../fluent/models/RoutePropertiesFormat.java | 159 + .../fluent/models/RouteTableInner.java | 176 + .../models/RouteTablePropertiesFormat.java | 131 + .../fluent/models/RoutingIntentInner.java | 143 + .../models/RoutingIntentProperties.java | 71 + .../fluent/models/ScopeConnectionInner.java | 140 + .../models/ScopeConnectionProperties.java | 118 + .../SecurityAdminConfigurationInner.java | 120 + ...ityAdminConfigurationPropertiesFormat.java | 95 + .../models/SecurityGroupViewResultInner.java | 55 + .../models/SecurityPartnerProviderInner.java | 167 + ...curityPartnerProviderPropertiesFormat.java | 110 + .../fluent/models/SecurityRuleInner.java | 498 + .../models/SecurityRulePropertiesFormat.java | 487 + ...erviceAssociationLinkPropertiesFormat.java | 145 + ...erviceAssociationLinksListResultInner.java | 70 + .../ServiceDelegationPropertiesFormat.java | 84 + .../ServiceEndpointPolicyDefinitionInner.java | 199 + ...pointPolicyDefinitionPropertiesFormat.java | 119 + .../models/ServiceEndpointPolicyInner.java | 216 + ...ServiceEndpointPolicyPropertiesFormat.java | 159 + .../models/ServiceTagInformationInner.java | 88 + .../models/ServiceTagsListResultInner.java | 133 + ...ureOverridesFilterValuesResponseInner.java | 51 + .../models/SignaturesOverridesInner.java | 135 + .../models/SignaturesOverridesListInner.java | 56 + .../fluent/models/StaticMemberInner.java | 103 + .../fluent/models/StaticMemberProperties.java | 81 + .../generated/fluent/models/SubnetInner.java | 478 + .../models/SubnetPropertiesFormatInner.java | 497 + .../fluent/models/SwapResourceInner.java | 99 + .../models/SwapResourceListResultInner.java | 54 + .../fluent/models/TopologyInner.java | 101 + .../models/TroubleshootingProperties.java | 91 + .../models/TroubleshootingResultInner.java | 134 + .../generated/fluent/models/UsageInner.java | 160 + .../models/VerificationIpFlowResultInner.java | 79 + .../models/VirtualApplianceSiteInner.java | 163 + .../VirtualApplianceSiteProperties.java | 96 + .../fluent/models/VirtualHubInner.java | 562 + .../fluent/models/VirtualHubProperties.java | 561 + .../models/VirtualHubRouteTableV2Inner.java | 151 + .../VirtualHubRouteTableV2Properties.java | 97 + .../VirtualNetworkGatewayConnectionInner.java | 667 + ...tworkGatewayConnectionListEntityInner.java | 581 + ...yConnectionListEntityPropertiesFormat.java | 623 + ...atewayConnectionPropertiesFormatInner.java | 726 + .../models/VirtualNetworkGatewayInner.java | 659 + ...atewayIpConfigurationPropertiesFormat.java | 137 + .../VirtualNetworkGatewayNatRuleInner.java | 237 + ...irtualNetworkGatewayNatRuleProperties.java | 180 + ...alNetworkGatewayPolicyGroupProperties.java | 148 + ...VirtualNetworkGatewayPropertiesFormat.java | 654 + .../fluent/models/VirtualNetworkInner.java | 428 + .../models/VirtualNetworkPeeringInner.java | 424 + ...VirtualNetworkPeeringPropertiesFormat.java | 400 + .../VirtualNetworkPropertiesFormat.java | 397 + .../fluent/models/VirtualNetworkTapInner.java | 213 + ...irtualNetworkTapPropertiesFormatInner.java | 166 + .../models/VirtualNetworkUsageInner.java | 103 + .../fluent/models/VirtualRouterInner.java | 212 + .../models/VirtualRouterPeeringInner.java | 162 + .../VirtualRouterPeeringProperties.java | 92 + .../models/VirtualRouterPropertiesFormat.java | 161 + .../fluent/models/VirtualWanInner.java | 231 + .../fluent/models/VirtualWanProperties.java | 192 + .../VirtualWanSecurityProvidersInner.java | 56 + ...ientConnectionConfigurationProperties.java | 117 + ...ConnectionHealthDetailListResultInner.java | 55 + .../models/VpnClientIPsecParametersInner.java | 281 + ...entRevokedCertificatePropertiesFormat.java | 66 + ...ClientRootCertificatePropertiesFormat.java | 75 + .../fluent/models/VpnConnectionInner.java | 484 + .../models/VpnConnectionProperties.java | 497 + .../fluent/models/VpnGatewayInner.java | 285 + .../fluent/models/VpnGatewayNatRuleInner.java | 255 + .../models/VpnGatewayNatRuleProperties.java | 211 + .../fluent/models/VpnGatewayProperties.java | 255 + .../models/VpnProfileResponseInner.java | 50 + .../models/VpnServerConfigurationInner.java | 446 + ...pnServerConfigurationPolicyGroupInner.java | 199 + ...verConfigurationPolicyGroupProperties.java | 140 + .../VpnServerConfigurationProperties.java | 457 + .../VpnServerConfigurationsResponseInner.java | 52 + .../generated/fluent/models/VpnSiteInner.java | 322 + .../models/VpnSiteLinkConnectionInner.java | 475 + .../VpnSiteLinkConnectionProperties.java | 464 + .../fluent/models/VpnSiteLinkInner.java | 212 + .../fluent/models/VpnSiteLinkProperties.java | 152 + .../fluent/models/VpnSiteProperties.java | 295 + .../WebApplicationFirewallPolicyInner.java | 220 + ...icationFirewallPolicyPropertiesFormat.java | 206 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + ...nectivityConfigurationsListResultImpl.java | 46 + ...ctiveSecurityAdminRulesListResultImpl.java | 45 + .../AdminRuleCollectionImpl.java | 202 + .../AdminRuleCollectionsClientImpl.java | 1316 + .../AdminRuleCollectionsImpl.java | 274 + .../implementation/AdminRulesClientImpl.java | 1462 ++ .../implementation/AdminRulesImpl.java | 180 + ...icationGatewayAvailableSslOptionsImpl.java | 92 + ...GatewayAvailableWafRuleSetsResultImpl.java | 42 + .../ApplicationGatewayBackendHealthImpl.java | 41 + ...ationGatewayBackendHealthOnDemandImpl.java | 39 + ...icationGatewayBackendHealthServerImpl.java | 53 + .../ApplicationGatewayImpl.java | 712 + ...nGatewayPrivateEndpointConnectionImpl.java | 71 + ...ivateEndpointConnectionPropertiesImpl.java | 55 + ...yPrivateEndpointConnectionsClientImpl.java | 1198 + ...GatewayPrivateEndpointConnectionsImpl.java | 119 + ...icationGatewayPrivateLinkResourceImpl.java | 69 + ...GatewayPrivateLinkResourcesClientImpl.java | 362 + ...cationGatewayPrivateLinkResourcesImpl.java | 50 + ...icationGatewaySslPredefinedPolicyImpl.java | 54 + ...onGatewayWafDynamicManifestResultImpl.java | 62 + ...nGatewayWafDynamicManifestsClientImpl.java | 324 + ...WafDynamicManifestsDefaultsClientImpl.java | 198 + ...atewayWafDynamicManifestsDefaultsImpl.java | 62 + ...icationGatewayWafDynamicManifestsImpl.java | 49 + .../ApplicationGatewaysClientImpl.java | 3711 +++ .../ApplicationGatewaysImpl.java | 381 + .../ApplicationSecurityGroupImpl.java | 192 + .../ApplicationSecurityGroupsClientImpl.java | 1503 ++ .../ApplicationSecurityGroupsImpl.java | 189 + .../AutoApprovedPrivateLinkServiceImpl.java | 33 + .../AvailableDelegationImpl.java | 56 + .../AvailableDelegationsClientImpl.java | 316 + .../AvailableDelegationsImpl.java | 46 + .../AvailableEndpointServicesClientImpl.java | 319 + .../AvailableEndpointServicesImpl.java | 46 + .../AvailablePrivateEndpointTypeImpl.java | 49 + ...ailablePrivateEndpointTypesClientImpl.java | 608 + .../AvailablePrivateEndpointTypesImpl.java | 59 + .../AvailableProvidersListImpl.java | 41 + ...bleResourceGroupDelegationsClientImpl.java | 350 + ...AvailableResourceGroupDelegationsImpl.java | 46 + .../AvailableServiceAliasImpl.java | 45 + .../AvailableServiceAliasesClientImpl.java | 606 + .../AvailableServiceAliasesImpl.java | 59 + .../AzureFirewallFqdnTagImpl.java | 69 + .../AzureFirewallFqdnTagsClientImpl.java | 291 + .../AzureFirewallFqdnTagsImpl.java | 46 + .../implementation/AzureFirewallImpl.java | 351 + .../AzureFirewallsClientImpl.java | 1813 ++ .../implementation/AzureFirewallsImpl.java | 194 + .../AzureReachabilityReportImpl.java | 50 + .../implementation/AzureWebCategoryImpl.java | 48 + ...AddressInboundNatRulePortMappingsImpl.java | 41 + .../BackendAddressPoolImpl.java | 269 + .../implementation/BaseAdminRuleImpl.java | 49 + .../BastionActiveSessionImpl.java | 74 + .../implementation/BastionHostImpl.java | 272 + .../BastionHostsClientImpl.java | 1549 ++ .../implementation/BastionHostsImpl.java | 169 + .../BastionSessionStateImpl.java | 41 + .../BastionShareableLinkImpl.java | 46 + .../implementation/BgpConnectionImpl.java | 173 + .../BgpPeerStatusListResultImpl.java | 41 + .../BgpServiceCommunitiesClientImpl.java | 290 + .../BgpServiceCommunitiesImpl.java | 46 + .../BgpServiceCommunityImpl.java | 71 + .../ConfigurationPolicyGroupsClientImpl.java | 1298 + .../ConfigurationPolicyGroupsImpl.java | 233 + .../ConnectionMonitorQueryResultImpl.java | 46 + .../ConnectionMonitorResultImpl.java | 370 + .../ConnectionMonitorsClientImpl.java | 2212 ++ .../ConnectionMonitorsImpl.java | 250 + .../ConnectionResetSharedKeyImpl.java | 33 + .../ConnectionSharedKeyImpl.java | 37 + .../ConnectivityConfigurationImpl.java | 223 + .../ConnectivityConfigurationsClientImpl.java | 1189 + .../ConnectivityConfigurationsImpl.java | 211 + .../ConnectivityInformationImpl.java | 66 + .../implementation/CustomIpPrefixImpl.java | 332 + .../CustomIpPrefixesClientImpl.java | 1453 ++ .../implementation/CustomIpPrefixesImpl.java | 180 + .../DdosCustomPoliciesClientImpl.java | 951 + .../DdosCustomPoliciesImpl.java | 157 + .../implementation/DdosCustomPolicyImpl.java | 190 + .../DdosProtectionPlanImpl.java | 211 + .../DdosProtectionPlansClientImpl.java | 1468 ++ .../DdosProtectionPlansImpl.java | 180 + .../DefaultSecurityRulesClientImpl.java | 535 + .../DefaultSecurityRulesImpl.java | 77 + .../DnsNameAvailabilityResultImpl.java | 33 + .../implementation/DscpConfigurationImpl.java | 294 + .../DscpConfigurationsClientImpl.java | 1274 + .../DscpConfigurationsImpl.java | 180 + ...iveNetworkSecurityGroupListResultImpl.java | 45 + .../EffectiveRouteListResultImpl.java | 45 + .../EndpointServiceResultImpl.java | 41 + .../ExpressRouteCircuitAuthorizationImpl.java | 166 + ...sRouteCircuitAuthorizationsClientImpl.java | 1183 + ...ExpressRouteCircuitAuthorizationsImpl.java | 209 + .../ExpressRouteCircuitConnectionImpl.java | 208 + ...ressRouteCircuitConnectionsClientImpl.java | 1300 + .../ExpressRouteCircuitConnectionsImpl.java | 237 + .../ExpressRouteCircuitImpl.java | 353 + .../ExpressRouteCircuitPeeringImpl.java | 347 + ...uteCircuitPeeringPropertiesFormatImpl.java | 151 + ...ExpressRouteCircuitPeeringsClientImpl.java | 1151 + .../ExpressRouteCircuitPeeringsImpl.java | 203 + .../ExpressRouteCircuitStatsImpl.java | 45 + ...ssRouteCircuitsArpTableListResultImpl.java | 45 + .../ExpressRouteCircuitsClientImpl.java | 2756 +++ .../ExpressRouteCircuitsImpl.java | 308 + ...outeCircuitsRoutesTableListResultImpl.java | 45 + ...cuitsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteConnectionImpl.java | 72 + .../ExpressRouteConnectionListImpl.java | 48 + .../ExpressRouteConnectionsClientImpl.java | 1069 + .../ExpressRouteConnectionsImpl.java | 136 + .../ExpressRouteCrossConnectionImpl.java | 263 + ...xpressRouteCrossConnectionPeeringImpl.java | 106 + ...outeCrossConnectionPeeringsClientImpl.java | 1183 + ...pressRouteCrossConnectionPeeringsImpl.java | 117 + ...xpressRouteCrossConnectionsClientImpl.java | 2283 ++ .../ExpressRouteCrossConnectionsImpl.java | 213 + ...tionsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteGatewayImpl.java | 240 + .../ExpressRouteGatewayListImpl.java | 48 + .../ExpressRouteGatewaysClientImpl.java | 1404 ++ .../ExpressRouteGatewaysImpl.java | 210 + .../implementation/ExpressRouteLinkImpl.java | 80 + .../ExpressRouteLinksClientImpl.java | 517 + .../implementation/ExpressRouteLinksImpl.java | 74 + .../ExpressRoutePortAuthorizationImpl.java | 161 + ...ressRoutePortAuthorizationsClientImpl.java | 1198 + .../ExpressRoutePortAuthorizationsImpl.java | 208 + .../implementation/ExpressRoutePortImpl.java | 287 + .../ExpressRoutePortsClientImpl.java | 1632 ++ .../implementation/ExpressRoutePortsImpl.java | 211 + .../ExpressRoutePortsLocationImpl.java | 80 + .../ExpressRoutePortsLocationsClientImpl.java | 434 + .../ExpressRoutePortsLocationsImpl.java | 70 + .../ExpressRouteProviderPortImpl.java | 92 + ...xpressRouteProviderPortListResultImpl.java | 52 + ...RouteProviderPortsLocationsClientImpl.java | 186 + ...xpressRouteProviderPortsLocationsImpl.java | 60 + .../ExpressRouteServiceProviderImpl.java | 81 + ...xpressRouteServiceProvidersClientImpl.java | 292 + .../ExpressRouteServiceProvidersImpl.java | 46 + .../FirewallPoliciesClientImpl.java | 1451 ++ .../implementation/FirewallPoliciesImpl.java | 180 + ...irewallPolicyIdpsSignaturesClientImpl.java | 238 + ...yIdpsSignaturesFilterValuesClientImpl.java | 254 + ...lPolicyIdpsSignaturesFilterValuesImpl.java | 67 + .../FirewallPolicyIdpsSignaturesImpl.java | 62 + ...licyIdpsSignaturesOverridesClientImpl.java | 758 + ...wallPolicyIdpsSignaturesOverridesImpl.java | 137 + .../implementation/FirewallPolicyImpl.java | 335 + ...FirewallPolicyRuleCollectionGroupImpl.java | 177 + ...lPolicyRuleCollectionGroupsClientImpl.java | 1191 + ...irewallPolicyRuleCollectionGroupsImpl.java | 218 + .../generated/implementation/FlowLogImpl.java | 250 + .../FlowLogInformationImpl.java | 56 + .../implementation/FlowLogsClientImpl.java | 1326 + .../implementation/FlowLogsImpl.java | 191 + .../FrontendIpConfigurationImpl.java | 142 + ...ndIpConfigurationPropertiesFormatImpl.java | 117 + .../GatewayRouteListResultImpl.java | 41 + ...enerateExpressRoutePortsLoaResultImpl.java | 33 + .../HubIpConfigurationImpl.java | 193 + ...ubIpConfigurationPropertiesFormatImpl.java | 65 + .../implementation/HubRouteTableImpl.java | 189 + .../HubRouteTablesClientImpl.java | 1149 + .../implementation/HubRouteTablesImpl.java | 191 + .../HubVirtualNetworkConnectionImpl.java | 68 + ...ubVirtualNetworkConnectionsClientImpl.java | 1185 + .../HubVirtualNetworkConnectionsImpl.java | 119 + .../implementation/InboundNatRuleImpl.java | 247 + .../InboundNatRulePropertiesFormatImpl.java | 87 + .../InboundNatRulesClientImpl.java | 1177 + .../implementation/InboundNatRulesImpl.java | 197 + .../InboundSecurityRuleImpl.java | 152 + ...boundSecurityRuleOperationsClientImpl.java | 436 + .../InboundSecurityRuleOperationsImpl.java | 36 + .../IpAddressAvailabilityResultImpl.java | 48 + .../implementation/IpAllocationImpl.java | 252 + .../IpAllocationsClientImpl.java | 1454 ++ .../implementation/IpAllocationsImpl.java | 172 + .../implementation/IpConfigurationImpl.java | 76 + .../IpConfigurationProfileImpl.java | 61 + ...figurationProfilePropertiesFormatImpl.java | 45 + .../IpConfigurationPropertiesFormatImpl.java | 65 + .../generated/implementation/IpGroupImpl.java | 220 + .../implementation/IpGroupsClientImpl.java | 1432 ++ .../implementation/IpGroupsImpl.java | 172 + .../implementation/IpPrefixesListImpl.java | 39 + ...BalancerBackendAddressPoolsClientImpl.java | 1174 + .../LoadBalancerBackendAddressPoolsImpl.java | 201 + ...cerFrontendIpConfigurationsClientImpl.java | 540 + ...dBalancerFrontendIpConfigurationsImpl.java | 79 + .../implementation/LoadBalancerImpl.java | 351 + ...dBalancerLoadBalancingRulesClientImpl.java | 529 + .../LoadBalancerLoadBalancingRulesImpl.java | 74 + ...adBalancerNetworkInterfacesClientImpl.java | 349 + .../LoadBalancerNetworkInterfacesImpl.java | 47 + .../LoadBalancerOutboundRulesClientImpl.java | 525 + .../LoadBalancerOutboundRulesImpl.java | 73 + .../LoadBalancerProbesClientImpl.java | 515 + .../LoadBalancerProbesImpl.java | 72 + .../LoadBalancersClientImpl.java | 2067 ++ .../implementation/LoadBalancersImpl.java | 217 + .../implementation/LoadBalancingRuleImpl.java | 107 + .../LocalNetworkGatewayImpl.java | 229 + .../LocalNetworkGatewaysClientImpl.java | 1251 + .../LocalNetworkGatewaysImpl.java | 174 + ...upNetworkManagerConnectionsClientImpl.java | 846 + ...entGroupNetworkManagerConnectionsImpl.java | 114 + .../implementation/NatGatewayImpl.java | 263 + .../implementation/NatGatewaysClientImpl.java | 1441 ++ .../implementation/NatGatewaysImpl.java | 172 + .../implementation/NatRulesClientImpl.java | 1131 + .../implementation/NatRulesImpl.java | 190 + ...rkConfigurationDiagnosticResponseImpl.java | 41 + .../implementation/NetworkGroupImpl.java | 187 + .../NetworkGroupsClientImpl.java | 1154 + .../implementation/NetworkGroupsImpl.java | 195 + .../implementation/NetworkInterfaceImpl.java | 414 + .../NetworkInterfaceIpConfigurationImpl.java | 177 + ...ceIpConfigurationPropertiesFormatImpl.java | 162 + ...rkInterfaceIpConfigurationsClientImpl.java | 535 + .../NetworkInterfaceIpConfigurationsImpl.java | 77 + ...tworkInterfaceLoadBalancersClientImpl.java | 349 + .../NetworkInterfaceLoadBalancersImpl.java | 47 + .../NetworkInterfacePropertiesFormatImpl.java | 172 + .../NetworkInterfaceTapConfigurationImpl.java | 166 + ...eTapConfigurationPropertiesFormatImpl.java | 46 + ...kInterfaceTapConfigurationsClientImpl.java | 1194 + ...NetworkInterfaceTapConfigurationsImpl.java | 214 + .../NetworkInterfacesClientImpl.java | 4426 ++++ .../implementation/NetworkInterfacesImpl.java | 471 + .../NetworkManagementClientBuilder.java | 146 + .../NetworkManagementClientImpl.java | 2107 ++ .../NetworkManagerCommitImpl.java | 58 + .../NetworkManagerCommitsClientImpl.java | 352 + .../NetworkManagerCommitsImpl.java | 56 + .../NetworkManagerConnectionImpl.java | 149 + ...ManagerDeploymentStatusListResultImpl.java | 45 + ...rDeploymentStatusOperationsClientImpl.java | 269 + ...ManagerDeploymentStatusOperationsImpl.java | 68 + ...nnectivityConfigurationListResultImpl.java | 46 + ...ctiveSecurityAdminRulesListResultImpl.java | 46 + .../implementation/NetworkManagerImpl.java | 228 + .../NetworkManagersClientImpl.java | 1512 ++ .../implementation/NetworkManagersImpl.java | 176 + .../implementation/NetworkProfileImpl.java | 221 + .../NetworkProfilesClientImpl.java | 1345 ++ .../implementation/NetworkProfilesImpl.java | 176 + .../NetworkSecurityGroupImpl.java | 281 + .../NetworkSecurityGroupsClientImpl.java | 1489 ++ .../NetworkSecurityGroupsImpl.java | 189 + .../NetworkVirtualApplianceImpl.java | 334 + .../NetworkVirtualApplianceSkuImpl.java | 84 + .../NetworkVirtualAppliancesClientImpl.java | 1508 ++ .../NetworkVirtualAppliancesImpl.java | 189 + .../implementation/NetworkWatcherImpl.java | 341 + .../NetworkWatchersClientImpl.java | 4760 ++++ .../implementation/NetworkWatchersImpl.java | 482 + .../implementation/NextHopResultImpl.java | 41 + .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 273 + .../implementation/OperationsImpl.java | 45 + .../implementation/OutboundRuleImpl.java | 82 + .../P2SVpnConnectionHealthImpl.java | 33 + .../implementation/P2SVpnGatewayImpl.java | 297 + .../P2SVpnGatewaysClientImpl.java | 2970 +++ .../implementation/P2SVpnGatewaysImpl.java | 271 + .../PacketCaptureQueryStatusResultImpl.java | 63 + .../PacketCaptureResultImpl.java | 89 + .../PacketCapturesClientImpl.java | 1615 ++ .../implementation/PacketCapturesImpl.java | 142 + ...PeerExpressRouteCircuitConnectionImpl.java | 76 + ...ressRouteCircuitConnectionsClientImpl.java | 566 + ...eerExpressRouteCircuitConnectionsImpl.java | 78 + .../implementation/PeerRouteListImpl.java | 40 + .../PrivateDnsZoneGroupImpl.java | 58 + .../PrivateDnsZoneGroupsClientImpl.java | 1179 + .../PrivateDnsZoneGroupsImpl.java | 121 + .../PrivateEndpointConnectionImpl.java | 70 + ...ivateEndpointConnectionPropertiesImpl.java | 54 + .../implementation/PrivateEndpointImpl.java | 308 + .../PrivateEndpointPropertiesImpl.java | 123 + .../PrivateEndpointsClientImpl.java | 1275 + .../implementation/PrivateEndpointsImpl.java | 183 + .../PrivateLinkServiceImpl.java | 308 + ...PrivateLinkServiceIpConfigurationImpl.java | 79 + ...kServiceIpConfigurationPropertiesImpl.java | 64 + .../PrivateLinkServiceVisibilityImpl.java | 33 + .../PrivateLinkServicesClientImpl.java | 3445 +++ .../PrivateLinkServicesImpl.java | 359 + .../generated/implementation/ProbeImpl.java | 85 + .../implementation/PublicIpAddressImpl.java | 393 + .../PublicIpAddressPropertiesFormatImpl.java | 135 + .../PublicIpAddressesClientImpl.java | 3732 +++ .../implementation/PublicIpAddressesImpl.java | 424 + ...ublicIpDdosProtectionStatusResultImpl.java | 46 + .../implementation/PublicIpPrefixImpl.java | 304 + .../PublicIpPrefixPropertiesFormatImpl.java | 93 + .../PublicIpPrefixesClientImpl.java | 1453 ++ .../implementation/PublicIpPrefixesImpl.java | 180 + .../implementation/QueryResultsImpl.java | 44 + .../ResourceNavigationLinksClientImpl.java | 234 + .../ResourceNavigationLinksImpl.java | 63 + ...ResourceNavigationLinksListResultImpl.java | 45 + .../ResourceProvidersClientImpl.java | 3286 +++ .../implementation/ResourceProvidersImpl.java | 373 + .../implementation/RouteFilterImpl.java | 240 + .../implementation/RouteFilterRuleImpl.java | 70 + .../RouteFilterRulesClientImpl.java | 1156 + .../implementation/RouteFilterRulesImpl.java | 115 + .../RouteFiltersClientImpl.java | 1455 ++ .../implementation/RouteFiltersImpl.java | 172 + .../generated/implementation/RouteImpl.java | 181 + .../implementation/RouteMapImpl.java | 179 + .../implementation/RouteMapsClientImpl.java | 1132 + .../implementation/RouteMapsImpl.java | 187 + .../implementation/RouteTableImpl.java | 233 + .../implementation/RouteTablesClientImpl.java | 1439 ++ .../implementation/RouteTablesImpl.java | 172 + .../implementation/RoutesClientImpl.java | 1115 + .../generated/implementation/RoutesImpl.java | 187 + .../implementation/RoutingIntentImpl.java | 157 + .../RoutingIntentsClientImpl.java | 1162 + .../implementation/RoutingIntentsImpl.java | 187 + .../implementation/ScopeConnectionImpl.java | 175 + .../ScopeConnectionsClientImpl.java | 971 + .../implementation/ScopeConnectionsImpl.java | 207 + .../SecurityAdminConfigurationImpl.java | 179 + ...SecurityAdminConfigurationsClientImpl.java | 1159 + .../SecurityAdminConfigurationsImpl.java | 215 + .../SecurityGroupViewResultImpl.java | 41 + .../SecurityPartnerProviderImpl.java | 213 + .../SecurityPartnerProvidersClientImpl.java | 1498 ++ .../SecurityPartnerProvidersImpl.java | 188 + .../implementation/SecurityRuleImpl.java | 335 + .../SecurityRulesClientImpl.java | 1178 + .../implementation/SecurityRulesImpl.java | 207 + .../ServiceAssociationLinksClientImpl.java | 234 + .../ServiceAssociationLinksImpl.java | 63 + ...ServiceAssociationLinksListResultImpl.java | 45 + .../ServiceEndpointPoliciesClientImpl.java | 1501 ++ .../ServiceEndpointPoliciesImpl.java | 189 + .../ServiceEndpointPolicyDefinitionImpl.java | 208 + ...ceEndpointPolicyDefinitionsClientImpl.java | 1301 + .../ServiceEndpointPolicyDefinitionsImpl.java | 240 + .../ServiceEndpointPolicyImpl.java | 258 + .../ServiceTagInformationImpl.java | 46 + .../ServiceTagInformationsClientImpl.java | 378 + .../ServiceTagInformationsImpl.java | 48 + .../implementation/ServiceTagsClientImpl.java | 197 + .../implementation/ServiceTagsImpl.java | 58 + .../ServiceTagsListResultImpl.java | 72 + ...tureOverridesFilterValuesResponseImpl.java | 40 + .../SignaturesOverridesImpl.java | 46 + .../SignaturesOverridesListImpl.java | 48 + .../implementation/StaticMemberImpl.java | 187 + .../StaticMembersClientImpl.java | 1089 + .../implementation/StaticMembersImpl.java | 249 + .../generated/implementation/SubnetImpl.java | 421 + .../SubnetPropertiesFormatImpl.java | 214 + .../implementation/SubnetsClientImpl.java | 1870 ++ .../generated/implementation/SubnetsImpl.java | 242 + ...onNetworkManagerConnectionsClientImpl.java | 821 + ...criptionNetworkManagerConnectionsImpl.java | 139 + .../implementation/SwapResourceImpl.java | 45 + .../SwapResourceListResultImpl.java | 48 + .../implementation/TopologyImpl.java | 52 + .../TroubleshootingResultImpl.java | 54 + .../generated/implementation/UsageImpl.java | 49 + .../implementation/UsagesClientImpl.java | 310 + .../generated/implementation/UsagesImpl.java | 45 + .../generated/implementation/Utils.java | 204 + .../VerificationIpFlowResultImpl.java | 38 + .../implementation/VipSwapsClientImpl.java | 679 + .../implementation/VipSwapsImpl.java | 91 + .../VirtualApplianceSiteImpl.java | 164 + .../VirtualApplianceSitesClientImpl.java | 1178 + .../VirtualApplianceSitesImpl.java | 216 + .../VirtualApplianceSkusClientImpl.java | 428 + .../VirtualApplianceSkusImpl.java | 70 + .../VirtualHubBgpConnectionsClientImpl.java | 1680 ++ .../VirtualHubBgpConnectionsImpl.java | 235 + .../implementation/VirtualHubImpl.java | 432 + .../VirtualHubIpConfigurationsClientImpl.java | 1140 + .../VirtualHubIpConfigurationsImpl.java | 197 + .../VirtualHubRouteTableV2Impl.java | 67 + .../VirtualHubRouteTableV2SClientImpl.java | 1164 + .../VirtualHubRouteTableV2SImpl.java | 116 + .../implementation/VirtualHubsClientImpl.java | 2414 ++ .../implementation/VirtualHubsImpl.java | 212 + .../VirtualNetworkGatewayConnectionImpl.java | 513 + ...etworkGatewayConnectionListEntityImpl.java | 184 + ...GatewayConnectionPropertiesFormatImpl.java | 199 + ...alNetworkGatewayConnectionsClientImpl.java | 3505 +++ .../VirtualNetworkGatewayConnectionsImpl.java | 307 + .../VirtualNetworkGatewayImpl.java | 588 + .../VirtualNetworkGatewayNatRuleImpl.java | 208 + ...rtualNetworkGatewayNatRulesClientImpl.java | 1203 + .../VirtualNetworkGatewayNatRulesImpl.java | 207 + .../VirtualNetworkGatewaysClientImpl.java | 6326 +++++ .../VirtualNetworkGatewaysImpl.java | 480 + .../implementation/VirtualNetworkImpl.java | 359 + .../VirtualNetworkPeeringImpl.java | 306 + .../VirtualNetworkPeeringsClientImpl.java | 1339 + .../VirtualNetworkPeeringsImpl.java | 214 + .../implementation/VirtualNetworkTapImpl.java | 253 + ...VirtualNetworkTapPropertiesFormatImpl.java | 83 + .../VirtualNetworkTapsClientImpl.java | 1437 ++ .../VirtualNetworkTapsImpl.java | 179 + .../VirtualNetworkUsageImpl.java | 50 + .../VirtualNetworksClientImpl.java | 2298 ++ .../implementation/VirtualNetworksImpl.java | 239 + .../implementation/VirtualRouterImpl.java | 224 + .../VirtualRouterPeeringImpl.java | 160 + .../VirtualRouterPeeringsClientImpl.java | 1139 + .../VirtualRouterPeeringsImpl.java | 195 + .../VirtualRoutersClientImpl.java | 1270 + .../implementation/VirtualRoutersImpl.java | 176 + .../implementation/VirtualWanImpl.java | 246 + .../VirtualWanSecurityProvidersImpl.java | 41 + .../implementation/VirtualWansClientImpl.java | 1435 ++ .../implementation/VirtualWansImpl.java | 169 + ...tConnectionHealthDetailListResultImpl.java | 41 + .../VpnClientIPsecParametersImpl.java | 67 + .../implementation/VpnConnectionImpl.java | 148 + .../VpnConnectionsClientImpl.java | 1904 ++ .../implementation/VpnConnectionsImpl.java | 146 + .../implementation/VpnGatewayImpl.java | 310 + .../implementation/VpnGatewayNatRuleImpl.java | 220 + .../implementation/VpnGatewaysClientImpl.java | 2524 ++ .../implementation/VpnGatewaysImpl.java | 213 + .../VpnLinkConnectionsClientImpl.java | 1014 + .../VpnLinkConnectionsImpl.java | 82 + .../VpnProfileResponseImpl.java | 33 + .../VpnServerConfigurationImpl.java | 394 + ...VpnServerConfigurationPolicyGroupImpl.java | 213 + ...nsAssociatedWithVirtualWansClientImpl.java | 330 + ...urationsAssociatedWithVirtualWansImpl.java | 56 + .../VpnServerConfigurationsClientImpl.java | 1533 ++ .../VpnServerConfigurationsImpl.java | 186 + .../VpnServerConfigurationsResponseImpl.java | 40 + .../generated/implementation/VpnSiteImpl.java | 284 + .../VpnSiteLinkConnectionImpl.java | 146 + .../VpnSiteLinkConnectionsClientImpl.java | 256 + .../VpnSiteLinkConnectionsImpl.java | 69 + .../implementation/VpnSiteLinkImpl.java | 67 + .../VpnSiteLinksClientImpl.java | 518 + .../implementation/VpnSiteLinksImpl.java | 72 + .../implementation/VpnSitesClientImpl.java | 1430 ++ .../VpnSitesConfigurationsClientImpl.java | 337 + .../VpnSitesConfigurationsImpl.java | 43 + .../implementation/VpnSitesImpl.java | 169 + ...ApplicationFirewallPoliciesClientImpl.java | 1164 + .../WebApplicationFirewallPoliciesImpl.java | 189 + .../WebApplicationFirewallPolicyImpl.java | 257 + .../WebCategoriesClientImpl.java | 430 + .../implementation/WebCategoriesImpl.java | 69 + .../implementation/package-info.java | 6 + .../models/AadAuthenticationParameters.java | 102 + .../network/generated/models/Access.java | 47 + .../network/generated/models/Action.java | 85 + .../network/generated/models/ActionType.java | 53 + .../models/ActiveBaseSecurityAdminRule.java | 228 + .../models/ActiveConfigurationParameter.java | 80 + .../ActiveConnectivityConfiguration.java | 136 + ...eConnectivityConfigurationsListResult.java | 34 + .../ActiveDefaultSecurityAdminRule.java | 216 + .../models/ActiveSecurityAdminRule.java | 321 + .../ActiveSecurityAdminRulesListResult.java | 34 + .../generated/models/AddressPrefixItem.java | 76 + .../generated/models/AddressPrefixType.java | 47 + .../generated/models/AddressSpace.java | 51 + .../network/generated/models/AdminRule.java | 271 + .../generated/models/AdminRuleCollection.java | 208 + .../models/AdminRuleCollectionListResult.java | 81 + .../models/AdminRuleCollections.java | 178 + .../generated/models/AdminRuleKind.java | 47 + .../generated/models/AdminRuleListResult.java | 81 + .../network/generated/models/AdminRules.java | 186 + .../generated/models/ApplicationGateway.java | 1020 + ...ationGatewayAuthenticationCertificate.java | 139 + ...licationGatewayAutoscaleConfiguration.java | 76 + ...ApplicationGatewayAvailableSslOptions.java | 84 + ...GatewayAvailableSslPredefinedPolicies.java | 82 + ...tionGatewayAvailableWafRuleSetsResult.java | 27 + .../ApplicationGatewayBackendAddress.java | 76 + .../ApplicationGatewayBackendAddressPool.java | 151 + .../ApplicationGatewayBackendHealth.java | 26 + ...ationGatewayBackendHealthHttpSettings.java | 86 + ...plicationGatewayBackendHealthOnDemand.java | 32 + .../ApplicationGatewayBackendHealthPool.java | 85 + ...ApplicationGatewayBackendHealthServer.java | 46 + ...ationGatewayBackendHealthServerHealth.java | 57 + ...ApplicationGatewayBackendHttpSettings.java | 429 + .../ApplicationGatewayBackendSettings.java | 283 + ...icationGatewayClientAuthConfiguration.java | 77 + ...icationGatewayClientRevocationOptions.java | 48 + .../ApplicationGatewayConnectionDraining.java | 81 + ...ApplicationGatewayCookieBasedAffinity.java | 48 + .../models/ApplicationGatewayCustomError.java | 76 + ...plicationGatewayCustomErrorStatusCode.java | 72 + ...ationGatewayFirewallDisabledRuleGroup.java | 89 + .../ApplicationGatewayFirewallExclusion.java | 130 + ...icationGatewayFirewallManifestRuleSet.java | 179 + .../ApplicationGatewayFirewallMode.java | 47 + .../ApplicationGatewayFirewallRule.java | 154 + .../ApplicationGatewayFirewallRuleGroup.java | 120 + .../ApplicationGatewayFirewallRuleSet.java | 187 + ...icationGatewayFrontendIpConfiguration.java | 233 + .../ApplicationGatewayFrontendPort.java | 139 + ...ApplicationGatewayGlobalConfiguration.java | 76 + ...ApplicationGatewayHeaderConfiguration.java | 76 + .../ApplicationGatewayHttpListener.java | 350 + .../ApplicationGatewayIpConfiguration.java | 141 + .../models/ApplicationGatewayListResult.java | 81 + .../models/ApplicationGatewayListener.java | 231 + ...ationGatewayLoadDistributionAlgorithm.java | 51 + ...licationGatewayLoadDistributionPolicy.java | 165 + ...licationGatewayLoadDistributionTarget.java | 153 + .../ApplicationGatewayOnDemandProbe.java | 248 + .../ApplicationGatewayOperationalState.java | 53 + .../models/ApplicationGatewayPathRule.java | 278 + ...ationGatewayPrivateEndpointConnection.java | 77 + ...ayPrivateEndpointConnectionListResult.java | 85 + ...ayPrivateEndpointConnectionProperties.java | 49 + ...tionGatewayPrivateEndpointConnections.java | 134 + ...cationGatewayPrivateLinkConfiguration.java | 141 + ...tionGatewayPrivateLinkIpConfiguration.java | 210 + ...ApplicationGatewayPrivateLinkResource.java | 68 + ...nGatewayPrivateLinkResourceListResult.java | 85 + ...pplicationGatewayPrivateLinkResources.java | 39 + .../models/ApplicationGatewayProbe.java | 386 + ...cationGatewayProbeHealthResponseMatch.java | 79 + .../models/ApplicationGatewayProtocol.java | 53 + ...plicationGatewayRedirectConfiguration.java | 292 + .../ApplicationGatewayRedirectType.java | 53 + .../ApplicationGatewayRequestRoutingRule.java | 323 + ...licationGatewayRequestRoutingRuleType.java | 48 + .../models/ApplicationGatewayRewriteRule.java | 138 + ...pplicationGatewayRewriteRuleActionSet.java | 115 + ...pplicationGatewayRewriteRuleCondition.java | 134 + .../ApplicationGatewayRewriteRuleSet.java | 125 + .../models/ApplicationGatewayRoutingRule.java | 231 + ...pplicationGatewayRuleSetStatusOptions.java | 54 + .../models/ApplicationGatewaySku.java | 102 + .../models/ApplicationGatewaySkuName.java | 62 + .../ApplicationGatewaySslCertificate.java | 197 + .../ApplicationGatewaySslCipherSuite.java | 153 + .../models/ApplicationGatewaySslPolicy.java | 156 + .../ApplicationGatewaySslPolicyName.java | 61 + .../ApplicationGatewaySslPolicyType.java | 50 + ...ApplicationGatewaySslPredefinedPolicy.java | 47 + .../models/ApplicationGatewaySslProfile.java | 191 + .../models/ApplicationGatewaySslProtocol.java | 53 + .../models/ApplicationGatewayTier.java | 53 + .../models/ApplicationGatewayTierTypes.java | 53 + ...cationGatewayTrustedClientCertificate.java | 157 + ...licationGatewayTrustedRootCertificate.java | 164 + .../ApplicationGatewayUrlConfiguration.java | 110 + .../models/ApplicationGatewayUrlPathMap.java | 255 + ...cationGatewayWafDynamicManifestResult.java | 61 + ...onGatewayWafDynamicManifestResultList.java | 82 + ...ApplicationGatewayWafDynamicManifests.java | 34 + ...ionGatewayWafDynamicManifestsDefaults.java | 34 + .../ApplicationGatewayWafRuleActionTypes.java | 57 + .../ApplicationGatewayWafRuleStateTypes.java | 48 + ...ayWebApplicationFirewallConfiguration.java | 320 + .../generated/models/ApplicationGateways.java | 420 + .../generated/models/ApplicationRule.java | 282 + .../models/ApplicationSecurityGroup.java | 222 + .../ApplicationSecurityGroupListResult.java | 70 + .../models/ApplicationSecurityGroups.java | 156 + .../generated/models/AssociationType.java | 47 + .../models/AuthenticationMethod.java | 47 + .../models/AuthorizationListResult.java | 83 + .../models/AuthorizationUseStatus.java | 47 + .../AutoApprovedPrivateLinkService.java | 25 + ...AutoApprovedPrivateLinkServicesResult.java | 70 + .../models/AutoLearnPrivateRangesMode.java | 47 + .../generated/models/Availability.java | 102 + .../generated/models/AvailableDelegation.java | 53 + .../models/AvailableDelegations.java | 36 + .../models/AvailableDelegationsResult.java | 70 + .../models/AvailableEndpointServices.java | 36 + .../models/AvailablePrivateEndpointType.java | 53 + .../models/AvailablePrivateEndpointTypes.java | 60 + .../AvailablePrivateEndpointTypesResult.java | 70 + .../models/AvailableProvidersList.java | 25 + .../models/AvailableProvidersListCity.java | 77 + .../models/AvailableProvidersListCountry.java | 106 + .../AvailableProvidersListParameters.java | 129 + .../models/AvailableProvidersListState.java | 106 + .../AvailableResourceGroupDelegations.java | 38 + .../models/AvailableServiceAlias.java | 45 + .../models/AvailableServiceAliases.java | 64 + .../models/AvailableServiceAliasesResult.java | 70 + .../generated/models/AzureFirewall.java | 465 + .../models/AzureFirewallApplicationRule.java | 210 + ...zureFirewallApplicationRuleCollection.java | 173 + .../AzureFirewallApplicationRuleProtocol.java | 77 + ...reFirewallApplicationRuleProtocolType.java | 51 + .../models/AzureFirewallFqdnTag.java | 74 + .../AzureFirewallFqdnTagListResult.java | 81 + .../models/AzureFirewallFqdnTags.java | 31 + .../models/AzureFirewallIpConfiguration.java | 178 + .../models/AzureFirewallIpGroups.java | 54 + .../models/AzureFirewallListResult.java | 81 + .../models/AzureFirewallNatRCAction.java | 50 + .../models/AzureFirewallNatRCActionType.java | 47 + .../models/AzureFirewallNatRule.java | 287 + .../AzureFirewallNatRuleCollection.java | 173 + .../models/AzureFirewallNetworkRule.java | 259 + .../AzureFirewallNetworkRuleCollection.java | 173 + .../AzureFirewallNetworkRuleProtocol.java | 53 + .../models/AzureFirewallPublicIpAddress.java | 50 + .../models/AzureFirewallRCAction.java | 50 + .../models/AzureFirewallRCActionType.java | 47 + .../generated/models/AzureFirewallSku.java | 76 + .../models/AzureFirewallSkuName.java | 47 + .../models/AzureFirewallSkuTier.java | 50 + .../models/AzureFirewallThreatIntelMode.java | 50 + .../generated/models/AzureFirewalls.java | 181 + .../models/AzureReachabilityReport.java | 40 + .../models/AzureReachabilityReportItem.java | 106 + .../AzureReachabilityReportLatencyInfo.java | 79 + .../AzureReachabilityReportLocation.java | 111 + .../AzureReachabilityReportParameters.java | 179 + .../generated/models/AzureWebCategory.java | 52 + .../models/AzureWebCategoryListResult.java | 81 + ...kendAddressInboundNatRulePortMappings.java | 26 + .../generated/models/BackendAddressPool.java | 371 + .../generated/models/BaseAdminRule.java | 53 + .../models/BastionActiveSession.java | 94 + .../BastionActiveSessionListResult.java | 81 + .../models/BastionConnectProtocol.java | 47 + .../network/generated/models/BastionHost.java | 377 + .../models/BastionHostIpConfiguration.java | 187 + .../models/BastionHostListResult.java | 81 + .../generated/models/BastionHostSkuName.java | 47 + .../generated/models/BastionHosts.java | 156 + .../models/BastionSessionDeleteResult.java | 81 + .../generated/models/BastionSessionState.java | 38 + .../models/BastionShareableLink.java | 46 + .../BastionShareableLinkListRequest.java | 55 + .../BastionShareableLinkListResult.java | 81 + .../generated/models/BgpCommunity.java | 184 + .../generated/models/BgpConnection.java | 262 + .../generated/models/BgpPeerState.java | 56 + .../generated/models/BgpPeerStatus.java | 144 + .../models/BgpPeerStatusListResult.java | 25 + .../models/BgpServiceCommunities.java | 31 + .../generated/models/BgpServiceCommunity.java | 68 + .../models/BgpServiceCommunityListResult.java | 81 + .../network/generated/models/BgpSettings.java | 132 + .../models/BreakOutCategoryPolicies.java | 102 + ...ckPrivateLinkServiceVisibilityRequest.java | 50 + .../generated/models/ChildResource.java | 40 + .../models/CircuitConnectionStatus.java | 50 + .../generated/models/CommissionedState.java | 66 + .../generated/models/ConfigurationGroup.java | 101 + .../models/ConfigurationPolicyGroups.java | 154 + .../generated/models/ConfigurationType.java | 47 + .../generated/models/ConnectionMonitor.java | 314 + .../models/ConnectionMonitorDestination.java | 102 + .../models/ConnectionMonitorEndpoint.java | 220 + .../ConnectionMonitorEndpointFilter.java | 80 + .../ConnectionMonitorEndpointFilterItem.java | 76 + ...nnectionMonitorEndpointFilterItemType.java | 45 + .../ConnectionMonitorEndpointFilterType.java | 45 + .../ConnectionMonitorEndpointScope.java | 83 + .../ConnectionMonitorEndpointScopeItem.java | 52 + .../ConnectionMonitorHttpConfiguration.java | 188 + .../ConnectionMonitorIcmpConfiguration.java | 50 + .../models/ConnectionMonitorListResult.java | 55 + .../models/ConnectionMonitorOutput.java | 79 + .../models/ConnectionMonitorQueryResult.java | 33 + .../models/ConnectionMonitorResult.java | 467 + .../models/ConnectionMonitorSource.java | 85 + .../models/ConnectionMonitorSourceStatus.java | 50 + .../ConnectionMonitorSuccessThreshold.java | 80 + .../ConnectionMonitorTcpConfiguration.java | 103 + .../ConnectionMonitorTestConfiguration.java | 264 + ...ctionMonitorTestConfigurationProtocol.java | 51 + .../models/ConnectionMonitorTestGroup.java | 181 + .../models/ConnectionMonitorType.java | 47 + .../ConnectionMonitorWorkspaceSettings.java | 50 + .../generated/models/ConnectionMonitors.java | 221 + .../models/ConnectionResetSharedKey.java | 24 + .../generated/models/ConnectionSharedKey.java | 31 + .../generated/models/ConnectionState.java | 50 + .../models/ConnectionStateSnapshot.java | 278 + .../generated/models/ConnectionStatus.java | 53 + .../models/ConnectivityConfiguration.java | 326 + .../ConnectivityConfigurationListResult.java | 84 + .../models/ConnectivityConfigurations.java | 167 + .../models/ConnectivityDestination.java | 102 + .../models/ConnectivityGroupItem.java | 143 + .../generated/models/ConnectivityHop.java | 169 + .../models/ConnectivityInformation.java | 67 + .../generated/models/ConnectivityIssue.java | 86 + .../models/ConnectivityParameters.java | 175 + .../generated/models/ConnectivitySource.java | 84 + .../models/ConnectivityTopology.java | 47 + .../network/generated/models/Container.java | 31 + .../models/ContainerNetworkInterface.java | 159 + ...ontainerNetworkInterfaceConfiguration.java | 169 + ...tainerNetworkInterfaceIpConfiguration.java | 109 + .../generated/models/CoverageLevel.java | 59 + .../network/generated/models/Criterion.java | 129 + .../generated/models/CrossTenantScopes.java | 70 + .../CustomDnsConfigPropertiesFormat.java | 77 + .../generated/models/CustomIpPrefix.java | 464 + .../models/CustomIpPrefixListResult.java | 81 + .../generated/models/CustomIpPrefixType.java | 50 + .../generated/models/CustomIpPrefixes.java | 158 + .../generated/models/DdosCustomPolicies.java | 112 + .../generated/models/DdosCustomPolicy.java | 222 + .../generated/models/DdosProtectionPlan.java | 240 + .../models/DdosProtectionPlanListResult.java | 70 + .../generated/models/DdosProtectionPlans.java | 156 + .../generated/models/DdosSettings.java | 79 + .../models/DdosSettingsProtectionMode.java | 50 + .../generated/models/DefaultAdminRule.java | 166 + .../models/DefaultSecurityRules.java | 65 + .../network/generated/models/Delegation.java | 164 + .../models/DelegationProperties.java | 65 + .../models/DeleteExistingPeering.java | 47 + .../generated/models/DeleteOptions.java | 47 + .../generated/models/DeploymentStatus.java | 53 + .../models/DestinationPortBehavior.java | 47 + .../generated/models/DeviceProperties.java | 102 + .../network/generated/models/DhGroup.java | 65 + .../network/generated/models/DhcpOptions.java | 54 + .../network/generated/models/Dimension.java | 102 + .../network/generated/models/Direction.java | 47 + .../models/DnsNameAvailabilityResult.java | 24 + .../network/generated/models/DnsSettings.java | 103 + .../generated/models/DscpConfiguration.java | 440 + .../models/DscpConfigurationListResult.java | 70 + .../generated/models/DscpConfigurations.java | 156 + .../models/EffectiveAdminRuleKind.java | 47 + .../EffectiveBaseSecurityAdminRule.java | 175 + .../EffectiveConnectivityConfiguration.java | 246 + .../EffectiveDefaultSecurityAdminRule.java | 201 + .../models/EffectiveNetworkSecurityGroup.java | 137 + ...ectiveNetworkSecurityGroupAssociation.java | 103 + ...fectiveNetworkSecurityGroupListResult.java | 33 + .../models/EffectiveNetworkSecurityRule.java | 428 + .../generated/models/EffectiveRoute.java | 209 + .../models/EffectiveRouteListResult.java | 32 + .../models/EffectiveRouteSource.java | 53 + .../generated/models/EffectiveRouteState.java | 47 + .../models/EffectiveRoutesParameters.java | 79 + .../models/EffectiveSecurityAdminRule.java | 306 + .../models/EffectiveSecurityRuleProtocol.java | 50 + .../models/EndpointServiceResult.java | 38 + .../models/EndpointServicesListResult.java | 81 + .../generated/models/EndpointType.java | 65 + .../network/generated/models/Error.java | 40 + .../generated/models/ErrorException.java | 38 + .../models/EvaluatedNetworkSecurityGroup.java | 124 + .../generated/models/EvaluationState.java | 50 + .../models/ExclusionManagedRule.java | 58 + .../models/ExclusionManagedRuleGroup.java | 91 + .../models/ExclusionManagedRuleSet.java | 121 + .../generated/models/ExplicitProxy.java | 180 + .../generated/models/ExpressRouteCircuit.java | 493 + .../models/ExpressRouteCircuitArpTable.java | 128 + .../ExpressRouteCircuitAuthorization.java | 227 + .../ExpressRouteCircuitAuthorizations.java | 142 + .../models/ExpressRouteCircuitConnection.java | 342 + ...pressRouteCircuitConnectionListResult.java | 84 + .../ExpressRouteCircuitConnections.java | 156 + .../models/ExpressRouteCircuitListResult.java | 81 + .../models/ExpressRouteCircuitPeering.java | 687 + ...uitPeeringAdvertisedPublicPrefixState.java | 56 + .../ExpressRouteCircuitPeeringConfig.java | 170 + .../models/ExpressRouteCircuitPeeringId.java | 50 + .../ExpressRouteCircuitPeeringListResult.java | 81 + ...ssRouteCircuitPeeringPropertiesFormat.java | 162 + .../ExpressRouteCircuitPeeringState.java | 47 + .../models/ExpressRouteCircuitPeerings.java | 142 + .../models/ExpressRouteCircuitReference.java | 50 + .../ExpressRouteCircuitRoutesTable.java | 156 + ...ExpressRouteCircuitRoutesTableSummary.java | 160 + ...RouteCircuitServiceProviderProperties.java | 102 + .../models/ExpressRouteCircuitSku.java | 102 + .../models/ExpressRouteCircuitSkuFamily.java | 47 + .../models/ExpressRouteCircuitSkuTier.java | 53 + .../models/ExpressRouteCircuitStats.java | 45 + .../models/ExpressRouteCircuits.java | 305 + ...xpressRouteCircuitsArpTableListResult.java | 33 + ...essRouteCircuitsRoutesTableListResult.java | 33 + ...eCircuitsRoutesTableSummaryListResult.java | 34 + .../models/ExpressRouteConnection.java | 89 + .../models/ExpressRouteConnectionId.java | 39 + .../models/ExpressRouteConnectionList.java | 25 + .../models/ExpressRouteConnections.java | 129 + .../models/ExpressRouteCrossConnection.java | 330 + ...ExpressRouteCrossConnectionListResult.java | 70 + .../ExpressRouteCrossConnectionPeering.java | 146 + ...xpressRouteCrossConnectionPeeringList.java | 70 + .../ExpressRouteCrossConnectionPeerings.java | 132 + ...outeCrossConnectionRoutesTableSummary.java | 134 + .../models/ExpressRouteCrossConnections.java | 215 + ...nnectionsRoutesTableSummaryListResult.java | 34 + .../generated/models/ExpressRouteGateway.java | 293 + .../models/ExpressRouteGatewayList.java | 25 + ...tewayPropertiesAutoScaleConfiguration.java | 54 + ...ropertiesAutoScaleConfigurationBounds.java | 76 + .../models/ExpressRouteGateways.java | 159 + .../generated/models/ExpressRouteLink.java | 103 + .../models/ExpressRouteLinkAdminState.java | 47 + .../models/ExpressRouteLinkConnectorType.java | 47 + .../models/ExpressRouteLinkListResult.java | 85 + .../models/ExpressRouteLinkMacSecCipher.java | 53 + .../models/ExpressRouteLinkMacSecConfig.java | 132 + .../ExpressRouteLinkMacSecSciState.java | 47 + .../generated/models/ExpressRouteLinks.java | 65 + .../models/ExpressRoutePeeringState.java | 47 + .../models/ExpressRoutePeeringType.java | 50 + .../generated/models/ExpressRoutePort.java | 376 + .../models/ExpressRoutePortAuthorization.java | 190 + ...pressRoutePortAuthorizationListResult.java | 85 + ...xpressRoutePortAuthorizationUseStatus.java | 48 + .../ExpressRoutePortAuthorizations.java | 143 + .../models/ExpressRoutePortListResult.java | 85 + .../generated/models/ExpressRoutePorts.java | 188 + .../models/ExpressRoutePortsBillingType.java | 47 + .../ExpressRoutePortsEncapsulation.java | 47 + .../models/ExpressRoutePortsLocation.java | 82 + .../ExpressRoutePortsLocationBandwidths.java | 58 + .../ExpressRoutePortsLocationListResult.java | 85 + .../models/ExpressRoutePortsLocations.java | 59 + .../models/ExpressRouteProviderPort.java | 116 + .../ExpressRouteProviderPortListResult.java | 33 + .../ExpressRouteProviderPortsLocations.java | 32 + .../models/ExpressRouteServiceProvider.java | 75 + ...RouteServiceProviderBandwidthsOffered.java | 76 + ...ExpressRouteServiceProviderListResult.java | 81 + .../models/ExpressRouteServiceProviders.java | 31 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationTypes.java | 44 + .../network/generated/models/FilterItems.java | 77 + .../generated/models/FirewallPolicies.java | 158 + .../generated/models/FirewallPolicy.java | 453 + .../FirewallPolicyCertificateAuthority.java | 78 + .../FirewallPolicyFilterRuleCollection.java | 103 + ...ewallPolicyFilterRuleCollectionAction.java | 50 + ...lPolicyFilterRuleCollectionActionType.java | 48 + .../FirewallPolicyIdpsQuerySortOrder.java | 47 + .../FirewallPolicyIdpsSignatureDirection.java | 54 + .../FirewallPolicyIdpsSignatureMode.java | 54 + .../FirewallPolicyIdpsSignatureSeverity.java | 54 + .../models/FirewallPolicyIdpsSignatures.java | 39 + ...ewallPolicyIdpsSignaturesFilterValues.java | 43 + ...FirewallPolicyIdpsSignaturesOverrides.java | 119 + .../models/FirewallPolicyInsights.java | 105 + .../FirewallPolicyIntrusionDetection.java | 80 + ...nDetectionBypassTrafficSpecifications.java | 238 + ...PolicyIntrusionDetectionConfiguration.java | 117 + ...ewallPolicyIntrusionDetectionProtocol.java | 54 + ...rusionDetectionSignatureSpecification.java | 77 + ...wallPolicyIntrusionDetectionStateType.java | 51 + .../models/FirewallPolicyListResult.java | 81 + .../FirewallPolicyLogAnalyticsResources.java | 81 + .../FirewallPolicyLogAnalyticsWorkspace.java | 77 + .../FirewallPolicyNatRuleCollection.java | 103 + ...FirewallPolicyNatRuleCollectionAction.java | 50 + ...wallPolicyNatRuleCollectionActionType.java | 45 + .../generated/models/FirewallPolicyRule.java | 90 + ...FirewallPolicyRuleApplicationProtocol.java | 77 + ...wallPolicyRuleApplicationProtocolType.java | 48 + .../models/FirewallPolicyRuleCollection.java | 89 + .../FirewallPolicyRuleCollectionGroup.java | 226 + ...llPolicyRuleCollectionGroupListResult.java | 81 + .../FirewallPolicyRuleCollectionGroups.java | 146 + .../FirewallPolicyRuleCollectionType.java | 49 + .../FirewallPolicyRuleNetworkProtocol.java | 53 + .../models/FirewallPolicyRuleType.java | 50 + .../generated/models/FirewallPolicySku.java | 50 + .../models/FirewallPolicySkuTier.java | 50 + .../generated/models/FirewallPolicySnat.java | 79 + .../generated/models/FirewallPolicySql.java | 53 + .../FirewallPolicyThreatIntelWhitelist.java | 77 + .../FirewallPolicyTransportSecurity.java | 54 + .../network/generated/models/FlowLog.java | 331 + .../models/FlowLogFormatParameters.java | 76 + .../generated/models/FlowLogFormatType.java | 44 + .../generated/models/FlowLogInformation.java | 60 + .../generated/models/FlowLogListResult.java | 70 + .../models/FlowLogStatusParameters.java | 61 + .../network/generated/models/FlowLogs.java | 142 + .../models/FrontendIpConfiguration.java | 141 + ...ontendIpConfigurationPropertiesFormat.java | 105 + ...ewayCustomBgpIpAddressIpConfiguration.java | 93 + .../GatewayLoadBalancerTunnelInterface.java | 128 + ...atewayLoadBalancerTunnelInterfaceType.java | 51 + .../GatewayLoadBalancerTunnelProtocol.java | 50 + .../generated/models/GatewayRoute.java | 129 + .../models/GatewayRouteListResult.java | 25 + .../GenerateExpressRoutePortsLoaRequest.java | 59 + .../GenerateExpressRoutePortsLoaResult.java | 25 + .../network/generated/models/Geo.java | 68 + .../models/GetInboundRoutesParameters.java | 79 + .../models/GetOutboundRoutesParameters.java | 79 + .../GetVpnSitesConfigurationRequest.java | 86 + .../generated/models/GroupConnectivity.java | 47 + .../network/generated/models/HopLink.java | 152 + .../generated/models/HttpConfiguration.java | 106 + .../models/HttpConfigurationMethod.java | 47 + .../network/generated/models/HttpHeader.java | 76 + .../network/generated/models/HttpMethod.java | 44 + .../network/generated/models/Hub.java | 76 + .../models/HubBgpConnectionStatus.java | 53 + .../generated/models/HubIpAddresses.java | 79 + .../generated/models/HubIpConfiguration.java | 283 + .../HubIpConfigurationPropertiesFormat.java | 53 + .../models/HubPublicIpAddresses.java | 82 + .../network/generated/models/HubRoute.java | 184 + .../generated/models/HubRouteTable.java | 238 + .../generated/models/HubRouteTables.java | 144 + .../models/HubRoutingPreference.java | 50 + .../models/HubVirtualNetworkConnection.java | 84 + .../models/HubVirtualNetworkConnections.java | 133 + .../generated/models/IdpsQueryObject.java | 161 + .../generated/models/IkeEncryption.java | 62 + .../generated/models/IkeIntegrity.java | 59 + .../generated/models/InboundNatPool.java | 317 + .../generated/models/InboundNatRule.java | 530 + .../models/InboundNatRuleListResult.java | 70 + .../models/InboundNatRulePortMapping.java | 84 + .../InboundNatRulePropertiesFormat.java | 113 + .../generated/models/InboundNatRules.java | 144 + .../generated/models/InboundSecurityRule.java | 178 + .../models/InboundSecurityRuleOperations.java | 16 + .../models/InboundSecurityRules.java | 102 + .../models/InboundSecurityRulesProtocol.java | 47 + .../models/IpAddressAvailabilityResult.java | 40 + .../generated/models/IpAllocation.java | 330 + .../models/IpAllocationListResult.java | 81 + .../generated/models/IpAllocationMethod.java | 47 + .../generated/models/IpAllocationType.java | 47 + .../generated/models/IpAllocations.java | 158 + .../generated/models/IpConfiguration.java | 74 + .../IpConfigurationBgpPeeringAddress.java | 108 + .../models/IpConfigurationProfile.java | 60 + ...pConfigurationProfilePropertiesFormat.java | 33 + .../IpConfigurationPropertiesFormat.java | 53 + .../generated/models/IpFlowProtocol.java | 47 + .../network/generated/models/IpGroup.java | 247 + .../generated/models/IpGroupListResult.java | 81 + .../network/generated/models/IpGroups.java | 172 + .../generated/models/IpPrefixesList.java | 25 + .../network/generated/models/IpTag.java | 76 + .../network/generated/models/IpVersion.java | 47 + .../generated/models/IpsecEncryption.java | 68 + .../generated/models/IpsecIntegrity.java | 59 + .../network/generated/models/IpsecPolicy.java | 271 + .../models/Ipv6CircuitConnectionConfig.java | 65 + .../Ipv6ExpressRouteCircuitPeeringConfig.java | 159 + .../network/generated/models/IsGlobal.java | 47 + .../generated/models/IsWorkloadProtected.java | 47 + .../network/generated/models/IssueType.java | 68 + .../models/ListHubRouteTablesResult.java | 81 + ...istHubVirtualNetworkConnectionsResult.java | 81 + .../models/ListP2SVpnGatewaysResult.java | 84 + .../generated/models/ListRouteMapsResult.java | 81 + .../models/ListRoutingIntentResult.java | 81 + .../ListVirtualHubBgpConnectionResults.java | 81 + .../ListVirtualHubIpConfigurationResults.java | 81 + .../ListVirtualHubRouteTableV2SResult.java | 81 + .../models/ListVirtualHubsResult.java | 84 + ...stVirtualNetworkGatewayNatRulesResult.java | 84 + .../models/ListVirtualWansResult.java | 84 + .../models/ListVpnConnectionsResult.java | 84 + .../models/ListVpnGatewayNatRulesResult.java | 84 + .../models/ListVpnGatewaysResult.java | 84 + ...ServerConfigurationPolicyGroupsResult.java | 84 + .../ListVpnServerConfigurationsResult.java | 84 + .../ListVpnSiteLinkConnectionsResult.java | 84 + .../models/ListVpnSiteLinksResult.java | 84 + .../generated/models/ListVpnSitesResult.java | 84 + .../generated/models/LoadBalancer.java | 420 + .../models/LoadBalancerBackendAddress.java | 211 + .../LoadBalancerBackendAddressAdminState.java | 57 + ...dBalancerBackendAddressPoolListResult.java | 70 + .../LoadBalancerBackendAddressPools.java | 142 + ...ncerFrontendIpConfigurationListResult.java | 70 + .../LoadBalancerFrontendIpConfigurations.java | 65 + .../models/LoadBalancerListResult.java | 70 + ...adBalancerLoadBalancingRuleListResult.java | 70 + .../LoadBalancerLoadBalancingRules.java | 65 + .../models/LoadBalancerNetworkInterfaces.java | 36 + .../LoadBalancerOutboundRuleListResult.java | 70 + .../LoadBalancerOutboundRuleProtocol.java | 50 + .../models/LoadBalancerOutboundRules.java | 65 + .../models/LoadBalancerProbeListResult.java | 70 + .../generated/models/LoadBalancerProbes.java | 65 + .../generated/models/LoadBalancerSku.java | 76 + .../generated/models/LoadBalancerSkuName.java | 50 + .../generated/models/LoadBalancerSkuTier.java | 47 + .../models/LoadBalancerVipSwapRequest.java | 55 + ...VipSwapRequestFrontendIpConfiguration.java | 93 + .../generated/models/LoadBalancers.java | 219 + .../generated/models/LoadBalancingRule.java | 147 + .../generated/models/LoadDistribution.java | 50 + .../generated/models/LocalNetworkGateway.java | 293 + .../models/LocalNetworkGatewayListResult.java | 70 + .../models/LocalNetworkGateways.java | 136 + .../generated/models/LogSpecification.java | 102 + .../models/ManagedRuleEnabledState.java | 47 + .../models/ManagedRuleGroupOverride.java | 91 + .../generated/models/ManagedRuleOverride.java | 110 + .../generated/models/ManagedRuleSet.java | 119 + .../models/ManagedRulesDefinition.java | 91 + .../models/ManagedServiceIdentity.java | 136 + ...ServiceIdentityUserAssignedIdentities.java | 54 + ...agementGroupNetworkManagerConnections.java | 125 + .../generated/models/MatchCondition.java | 175 + .../generated/models/MatchVariable.java | 84 + .../network/generated/models/MatchedRule.java | 76 + .../generated/models/MetricSpecification.java | 395 + .../network/generated/models/NatGateway.java | 323 + .../models/NatGatewayListResult.java | 81 + .../generated/models/NatGatewaySku.java | 50 + .../generated/models/NatGatewaySkuName.java | 44 + .../network/generated/models/NatGateways.java | 158 + .../network/generated/models/NatRule.java | 253 + .../generated/models/NatRulePortMapping.java | 102 + .../network/generated/models/NatRules.java | 144 + ...workConfigurationDiagnosticParameters.java | 124 + ...NetworkConfigurationDiagnosticProfile.java | 189 + ...etworkConfigurationDiagnosticResponse.java | 26 + .../NetworkConfigurationDiagnosticResult.java | 83 + .../generated/models/NetworkGroup.java | 204 + .../models/NetworkGroupListResult.java | 84 + .../generated/models/NetworkGroups.java | 153 + .../NetworkGroupsCreateOrUpdateHeaders.java | 58 + .../NetworkGroupsCreateOrUpdateResponse.java | 42 + .../generated/models/NetworkIntentPolicy.java | 81 + .../NetworkIntentPolicyBasedService.java | 50 + .../NetworkIntentPolicyConfiguration.java | 82 + .../generated/models/NetworkInterface.java | 544 + .../models/NetworkInterfaceAssociation.java | 70 + .../models/NetworkInterfaceAuxiliaryMode.java | 50 + .../models/NetworkInterfaceDnsSettings.java | 137 + .../NetworkInterfaceIpConfiguration.java | 150 + ...orkInterfaceIpConfigurationListResult.java | 70 + ...rationPrivateLinkConnectionProperties.java | 70 + ...erfaceIpConfigurationPropertiesFormat.java | 122 + .../NetworkInterfaceIpConfigurations.java | 67 + .../models/NetworkInterfaceListResult.java | 70 + ...etworkInterfaceLoadBalancerListResult.java | 70 + .../models/NetworkInterfaceLoadBalancers.java | 36 + .../NetworkInterfaceMigrationPhase.java | 56 + .../models/NetworkInterfaceNicType.java | 47 + .../NetworkInterfacePropertiesFormat.java | 170 + .../NetworkInterfaceTapConfiguration.java | 197 + ...rkInterfaceTapConfigurationListResult.java | 70 + ...rfaceTapConfigurationPropertiesFormat.java | 33 + .../NetworkInterfaceTapConfigurations.java | 144 + .../generated/models/NetworkInterfaces.java | 491 + .../generated/models/NetworkManager.java | 277 + .../models/NetworkManagerCommit.java | 46 + .../models/NetworkManagerCommits.java | 40 + .../models/NetworkManagerConnection.java | 186 + .../NetworkManagerConnectionListResult.java | 81 + .../NetworkManagerDeploymentStatus.java | 182 + ...workManagerDeploymentStatusListResult.java | 34 + ...workManagerDeploymentStatusOperations.java | 46 + ...tworkManagerDeploymentStatusParameter.java | 105 + ...veConnectivityConfigurationListResult.java | 35 + ...EffectiveSecurityAdminRulesListResult.java | 35 + .../models/NetworkManagerListResult.java | 84 + ...ManagerPropertiesNetworkManagerScopes.java | 95 + .../NetworkManagerSecurityGroupItem.java | 59 + .../generated/models/NetworkManagers.java | 171 + .../generated/models/NetworkProfile.java | 249 + .../models/NetworkProfileListResult.java | 81 + .../generated/models/NetworkProfiles.java | 158 + .../network/generated/models/NetworkRule.java | 227 + .../models/NetworkSecurityGroup.java | 290 + .../NetworkSecurityGroupListResult.java | 81 + .../models/NetworkSecurityGroupResult.java | 69 + .../models/NetworkSecurityGroups.java | 158 + .../NetworkSecurityRulesEvaluationResult.java | 180 + .../models/NetworkVirtualAppliance.java | 435 + .../NetworkVirtualApplianceListResult.java | 81 + ...NetworkVirtualApplianceSiteListResult.java | 81 + .../models/NetworkVirtualApplianceSku.java | 82 + .../NetworkVirtualApplianceSkuInstances.java | 58 + .../NetworkVirtualApplianceSkuListResult.java | 81 + .../models/NetworkVirtualAppliances.java | 160 + .../generated/models/NetworkWatcher.java | 505 + .../models/NetworkWatcherListResult.java | 55 + .../generated/models/NetworkWatchers.java | 527 + .../generated/models/NextHopParameters.java | 154 + .../generated/models/NextHopResult.java | 40 + .../network/generated/models/NextHopType.java | 59 + .../network/generated/models/NextStep.java | 50 + .../models/O365BreakOutCategoryPolicies.java | 102 + .../models/O365PolicyProperties.java | 53 + .../models/Office365PolicyProperties.java | 53 + .../models/OfficeTrafficCategory.java | 53 + .../network/generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 128 + .../generated/models/OperationListResult.java | 84 + ...nPropertiesFormatServiceSpecification.java | 85 + .../network/generated/models/Operations.java | 31 + .../network/generated/models/OrderBy.java | 76 + .../network/generated/models/Origin.java | 50 + .../generated/models/OutboundRule.java | 99 + .../network/generated/models/OutputType.java | 44 + .../models/OwaspCrsExclusionEntry.java | 159 + .../OwaspCrsExclusionEntryMatchVariable.java | 69 + ...rsExclusionEntrySelectorMatchOperator.java | 60 + .../models/P2SConnectionConfiguration.java | 202 + .../models/P2SVpnConnectionHealth.java | 25 + .../models/P2SVpnConnectionHealthRequest.java | 79 + .../models/P2SVpnConnectionRequest.java | 51 + .../generated/models/P2SVpnGateway.java | 426 + .../generated/models/P2SVpnGateways.java | 295 + .../models/P2SVpnProfileParameters.java | 50 + .../generated/models/PacketCapture.java | 239 + .../generated/models/PacketCaptureFilter.java | 178 + .../models/PacketCaptureListResult.java | 55 + .../models/PacketCaptureMachineScope.java | 82 + .../PacketCaptureQueryStatusResult.java | 62 + .../generated/models/PacketCaptureResult.java | 105 + .../models/PacketCaptureStorageLocation.java | 112 + .../models/PacketCaptureTargetType.java | 51 + .../generated/models/PacketCaptures.java | 179 + .../network/generated/models/Parameter.java | 103 + .../PartnerManagedResourceProperties.java | 69 + .../network/generated/models/PatchObject.java | 53 + .../network/generated/models/PcError.java | 56 + .../network/generated/models/PcProtocol.java | 50 + .../network/generated/models/PcStatus.java | 56 + .../PeerExpressRouteCircuitConnection.java | 101 + ...pressRouteCircuitConnectionListResult.java | 86 + .../PeerExpressRouteCircuitConnections.java | 75 + .../network/generated/models/PeerRoute.java | 129 + .../generated/models/PeerRouteList.java | 25 + .../network/generated/models/PfsGroup.java | 68 + .../generated/models/PolicySettings.java | 211 + .../generated/models/PreferredIpVersion.java | 50 + .../models/PreferredRoutingGateway.java | 50 + .../models/PrepareNetworkPoliciesRequest.java | 81 + .../models/PrivateDnsZoneConfig.java | 105 + .../generated/models/PrivateDnsZoneGroup.java | 55 + .../models/PrivateDnsZoneGroupListResult.java | 70 + .../models/PrivateDnsZoneGroups.java | 131 + .../generated/models/PrivateEndpoint.java | 490 + .../models/PrivateEndpointConnection.java | 75 + .../PrivateEndpointConnectionListResult.java | 70 + .../PrivateEndpointConnectionProperties.java | 47 + .../PrivateEndpointIpConfiguration.java | 172 + .../models/PrivateEndpointListResult.java | 70 + .../models/PrivateEndpointProperties.java | 87 + .../generated/models/PrivateEndpoints.java | 170 + .../generated/models/PrivateLinkService.java | 452 + .../models/PrivateLinkServiceConnection.java | 218 + .../PrivateLinkServiceConnectionState.java | 106 + .../PrivateLinkServiceIpConfiguration.java | 90 + ...eLinkServiceIpConfigurationProperties.java | 63 + .../models/PrivateLinkServiceListResult.java | 70 + ...vateLinkServicePropertiesAutoApproval.java | 33 + ...rivateLinkServicePropertiesVisibility.java | 33 + .../models/PrivateLinkServiceVisibility.java | 25 + .../generated/models/PrivateLinkServices.java | 420 + .../network/generated/models/Probe.java | 115 + .../generated/models/ProbeProtocol.java | 53 + .../models/ProcessorArchitecture.java | 47 + .../models/PropagatedRouteTable.java | 78 + .../network/generated/models/Protocol.java | 53 + .../models/ProtocolConfiguration.java | 53 + .../generated/models/ProtocolType.java | 68 + .../generated/models/ProvisioningState.java | 53 + .../generated/models/PublicIpAddress.java | 546 + .../models/PublicIpAddressDnsSettings.java | 117 + .../models/PublicIpAddressListResult.java | 81 + .../models/PublicIpAddressMigrationPhase.java | 56 + .../PublicIpAddressPropertiesFormat.java | 132 + .../generated/models/PublicIpAddressSku.java | 76 + .../models/PublicIpAddressSkuName.java | 47 + .../models/PublicIpAddressSkuTier.java | 47 + .../generated/models/PublicIpAddresses.java | 427 + .../PublicIpDdosProtectionStatusResult.java | 47 + .../generated/models/PublicIpPrefix.java | 392 + .../models/PublicIpPrefixListResult.java | 81 + .../PublicIpPrefixPropertiesFormat.java | 91 + .../generated/models/PublicIpPrefixSku.java | 76 + .../models/PublicIpPrefixSkuName.java | 44 + .../models/PublicIpPrefixSkuTier.java | 47 + .../generated/models/PublicIpPrefixes.java | 158 + .../generated/models/QosDefinition.java | 193 + .../network/generated/models/QosIpRange.java | 76 + .../generated/models/QosPortRange.java | 76 + ...QueryInboundNatRulePortMappingRequest.java | 77 + .../generated/models/QueryRequestOptions.java | 53 + .../generated/models/QueryResults.java | 32 + .../QueryTroubleshootingParameters.java | 59 + .../generated/models/RadiusServer.java | 111 + .../network/generated/models/RecordSet.java | 170 + .../models/ReferencedPublicIpAddress.java | 50 + .../models/ResourceIdentityType.java | 61 + .../models/ResourceNavigationLink.java | 164 + .../models/ResourceNavigationLinks.java | 39 + .../ResourceNavigationLinksListResult.java | 33 + .../generated/models/ResourceProviders.java | 406 + .../network/generated/models/ResourceSet.java | 51 + .../models/RetentionPolicyParameters.java | 76 + .../network/generated/models/Route.java | 318 + .../network/generated/models/RouteFilter.java | 246 + .../models/RouteFilterListResult.java | 81 + .../generated/models/RouteFilterRule.java | 76 + .../models/RouteFilterRuleListResult.java | 81 + .../generated/models/RouteFilterRuleType.java | 44 + .../generated/models/RouteFilterRules.java | 129 + .../generated/models/RouteFilters.java | 158 + .../generated/models/RouteListResult.java | 81 + .../network/generated/models/RouteMap.java | 242 + .../generated/models/RouteMapActionType.java | 59 + .../models/RouteMapMatchCondition.java | 56 + .../generated/models/RouteMapRule.java | 137 + .../network/generated/models/RouteMaps.java | 144 + .../generated/models/RouteNextHopType.java | 56 + .../network/generated/models/RouteTable.java | 269 + .../models/RouteTableListResult.java | 81 + .../network/generated/models/RouteTables.java | 158 + .../network/generated/models/Routes.java | 141 + .../models/RoutingConfiguration.java | 167 + .../generated/models/RoutingIntent.java | 196 + .../generated/models/RoutingIntents.java | 144 + .../generated/models/RoutingPolicy.java | 123 + .../generated/models/RoutingState.java | 53 + .../generated/models/ScopeConnection.java | 233 + .../models/ScopeConnectionListResult.java | 81 + .../models/ScopeConnectionState.java | 56 + .../generated/models/ScopeConnections.java | 151 + .../models/SecurityAdminConfiguration.java | 217 + .../SecurityAdminConfigurationListResult.java | 81 + .../models/SecurityAdminConfigurations.java | 153 + .../SecurityConfigurationRuleAccess.java | 50 + .../SecurityConfigurationRuleDirection.java | 47 + .../SecurityConfigurationRuleProtocol.java | 59 + .../models/SecurityGroupNetworkInterface.java | 80 + .../models/SecurityGroupViewParameters.java | 59 + .../models/SecurityGroupViewResult.java | 25 + .../models/SecurityPartnerProvider.java | 258 + ...curityPartnerProviderConnectionStatus.java | 54 + .../SecurityPartnerProviderListResult.java | 81 + .../models/SecurityPartnerProviders.java | 158 + .../models/SecurityProviderName.java | 50 + .../generated/models/SecurityRule.java | 684 + .../generated/models/SecurityRuleAccess.java | 47 + .../models/SecurityRuleAssociations.java | 144 + .../models/SecurityRuleDirection.java | 47 + .../models/SecurityRuleListResult.java | 84 + .../models/SecurityRuleProtocol.java | 59 + .../generated/models/SecurityRules.java | 142 + .../models/ServiceAssociationLink.java | 211 + .../models/ServiceAssociationLinks.java | 39 + .../ServiceAssociationLinksListResult.java | 33 + .../models/ServiceEndpointPolicies.java | 158 + .../models/ServiceEndpointPolicy.java | 296 + .../ServiceEndpointPolicyDefinition.java | 281 + ...iceEndpointPolicyDefinitionListResult.java | 84 + .../ServiceEndpointPolicyDefinitions.java | 157 + .../ServiceEndpointPolicyListResult.java | 70 + .../ServiceEndpointPropertiesFormat.java | 92 + .../ServiceProviderProvisioningState.java | 53 + .../models/ServiceTagInformation.java | 45 + .../ServiceTagInformationListResult.java | 70 + ...ServiceTagInformationPropertiesFormat.java | 100 + .../models/ServiceTagInformations.java | 43 + .../network/generated/models/ServiceTags.java | 38 + .../models/ServiceTagsListResult.java | 67 + .../network/generated/models/SessionIds.java | 51 + .../network/generated/models/Severity.java | 47 + .../SignatureOverridesFilterValuesQuery.java | 50 + ...ignatureOverridesFilterValuesResponse.java | 26 + .../generated/models/SignaturesOverrides.java | 46 + .../models/SignaturesOverridesList.java | 26 + .../models/SignaturesOverridesProperties.java | 53 + .../generated/models/SingleQueryResult.java | 313 + .../network/generated/models/Sku.java | 50 + .../network/generated/models/SlotType.java | 51 + .../generated/models/StaticMember.java | 187 + .../models/StaticMemberListResult.java | 84 + .../generated/models/StaticMembers.java | 171 + .../network/generated/models/StaticRoute.java | 103 + .../generated/models/StaticRoutesConfig.java | 72 + .../network/generated/models/Subnet.java | 657 + .../generated/models/SubnetAssociation.java | 70 + .../generated/models/SubnetListResult.java | 81 + .../models/SubnetPropertiesFormat.java | 157 + .../network/generated/models/Subnets.java | 220 + ...SubscriptionNetworkManagerConnections.java | 135 + .../generated/models/SwapResource.java | 45 + .../models/SwapResourceListResult.java | 25 + .../models/SwapResourceProperties.java | 50 + .../models/SyncRemoteAddressSpace.java | 44 + .../network/generated/models/TagsObject.java | 53 + .../network/generated/models/Topology.java | 47 + .../generated/models/TopologyAssociation.java | 102 + .../generated/models/TopologyParameters.java | 103 + .../generated/models/TopologyResource.java | 134 + ...afficAnalyticsConfigurationProperties.java | 156 + .../models/TrafficAnalyticsProperties.java | 56 + .../models/TrafficSelectorPolicy.java | 92 + .../generated/models/TransportProtocol.java | 50 + .../models/TroubleshootingDetails.java | 158 + .../models/TroubleshootingParameters.java | 129 + .../TroubleshootingRecommendedActions.java | 128 + .../models/TroubleshootingResult.java | 47 + .../models/TunnelConnectionHealth.java | 99 + .../UnprepareNetworkPoliciesRequest.java | 50 + .../network/generated/models/Usage.java | 52 + .../network/generated/models/UsageName.java | 76 + .../network/generated/models/UsageUnit.java | 44 + .../network/generated/models/Usages.java | 34 + .../generated/models/UsagesListResult.java | 81 + .../generated/models/UseHubGateway.java | 47 + .../network/generated/models/VM.java | 66 + .../generated/models/VerbosityLevel.java | 50 + .../models/VerificationIpFlowParameters.java | 286 + .../models/VerificationIpFlowResult.java | 32 + .../network/generated/models/VipSwaps.java | 95 + .../models/VirtualApplianceNicProperties.java | 69 + .../models/VirtualApplianceSite.java | 219 + .../models/VirtualApplianceSites.java | 145 + .../models/VirtualApplianceSkuProperties.java | 102 + .../models/VirtualApplianceSkus.java | 57 + .../network/generated/models/VirtualHub.java | 625 + .../models/VirtualHubBgpConnections.java | 197 + .../generated/models/VirtualHubId.java | 53 + .../models/VirtualHubIpConfigurations.java | 142 + .../generated/models/VirtualHubRoute.java | 77 + .../models/VirtualHubRouteTable.java | 54 + .../models/VirtualHubRouteTableV2.java | 61 + .../models/VirtualHubRouteTableV2S.java | 137 + .../generated/models/VirtualHubRouteV2.java | 129 + .../network/generated/models/VirtualHubs.java | 244 + .../generated/models/VirtualNetwork.java | 493 + .../models/VirtualNetworkBgpCommunities.java | 74 + ...tualNetworkConnectionGatewayReference.java | 59 + ...tualNetworkDdosProtectionStatusResult.java | 81 + .../models/VirtualNetworkEncryption.java | 76 + .../VirtualNetworkEncryptionEnforcement.java | 48 + .../models/VirtualNetworkGateway.java | 961 + .../VirtualNetworkGatewayConnection.java | 738 + ...ualNetworkGatewayConnectionListEntity.java | 226 + ...ualNetworkGatewayConnectionListResult.java | 70 + .../VirtualNetworkGatewayConnectionMode.java | 51 + ...workGatewayConnectionPropertiesFormat.java | 212 + ...rtualNetworkGatewayConnectionProtocol.java | 48 + ...VirtualNetworkGatewayConnectionStatus.java | 54 + .../VirtualNetworkGatewayConnectionType.java | 54 + .../VirtualNetworkGatewayConnections.java | 364 + .../VirtualNetworkGatewayIpConfiguration.java | 183 + ...alNetworkGatewayListConnectionsResult.java | 71 + .../VirtualNetworkGatewayListResult.java | 70 + .../models/VirtualNetworkGatewayNatRule.java | 317 + .../models/VirtualNetworkGatewayNatRules.java | 146 + .../VirtualNetworkGatewayPolicyGroup.java | 183 + ...irtualNetworkGatewayPolicyGroupMember.java | 102 + .../models/VirtualNetworkGatewaySku.java | 91 + .../models/VirtualNetworkGatewaySkuName.java | 92 + .../models/VirtualNetworkGatewaySkuTier.java | 92 + .../models/VirtualNetworkGatewayType.java | 50 + .../models/VirtualNetworkGateways.java | 633 + .../models/VirtualNetworkListResult.java | 81 + .../models/VirtualNetworkListUsageResult.java | 70 + .../models/VirtualNetworkPeering.java | 603 + .../models/VirtualNetworkPeeringLevel.java | 53 + .../VirtualNetworkPeeringListResult.java | 81 + .../models/VirtualNetworkPeeringState.java | 50 + .../models/VirtualNetworkPeerings.java | 142 + ...NetworkPrivateEndpointNetworkPolicies.java | 48 + ...workPrivateLinkServiceNetworkPolicies.java | 48 + .../generated/models/VirtualNetworkTap.java | 299 + .../models/VirtualNetworkTapListResult.java | 81 + .../VirtualNetworkTapPropertiesFormat.java | 64 + .../generated/models/VirtualNetworkTaps.java | 156 + .../generated/models/VirtualNetworkUsage.java | 52 + .../models/VirtualNetworkUsageName.java | 54 + .../generated/models/VirtualNetworks.java | 245 + .../generated/models/VirtualRouter.java | 340 + .../VirtualRouterAutoScaleConfiguration.java | 50 + .../models/VirtualRouterListResult.java | 81 + .../models/VirtualRouterPeering.java | 218 + .../VirtualRouterPeeringListResult.java | 81 + .../models/VirtualRouterPeerings.java | 152 + .../generated/models/VirtualRouters.java | 170 + .../network/generated/models/VirtualWan.java | 309 + .../models/VirtualWanSecurityProvider.java | 91 + .../VirtualWanSecurityProviderType.java | 47 + .../models/VirtualWanSecurityProviders.java | 25 + .../VirtualWanVpnProfileParameters.java | 79 + .../network/generated/models/VirtualWans.java | 156 + .../VnetLocalRouteOverrideCriteria.java | 47 + .../network/generated/models/VnetRoute.java | 99 + .../VngClientConnectionConfiguration.java | 153 + .../models/VpnAuthenticationType.java | 50 + .../models/VpnClientConfiguration.java | 401 + .../models/VpnClientConnectionHealth.java | 109 + .../VpnClientConnectionHealthDetail.java | 204 + ...lientConnectionHealthDetailListResult.java | 26 + .../models/VpnClientIPsecParameters.java | 75 + .../generated/models/VpnClientParameters.java | 137 + .../generated/models/VpnClientProtocol.java | 50 + .../models/VpnClientRevokedCertificate.java | 126 + .../models/VpnClientRootCertificate.java | 134 + .../generated/models/VpnConnection.java | 175 + ...onnectionPacketCaptureStartParameters.java | 77 + ...ConnectionPacketCaptureStopParameters.java | 77 + .../generated/models/VpnConnectionStatus.java | 53 + .../generated/models/VpnConnections.java | 198 + .../models/VpnDeviceScriptParameters.java | 102 + .../network/generated/models/VpnGateway.java | 418 + .../models/VpnGatewayGeneration.java | 50 + .../models/VpnGatewayIpConfiguration.java | 102 + .../generated/models/VpnGatewayNatRule.java | 331 + ...pnGatewayPacketCaptureStartParameters.java | 50 + ...VpnGatewayPacketCaptureStopParameters.java | 50 + .../models/VpnGatewayTunnelingProtocol.java | 47 + .../network/generated/models/VpnGateways.java | 241 + .../generated/models/VpnLinkBgpSettings.java | 76 + .../models/VpnLinkConnectionMode.java | 50 + .../generated/models/VpnLinkConnections.java | 109 + .../models/VpnLinkProviderProperties.java | 76 + .../generated/models/VpnNatRuleMapping.java | 76 + .../generated/models/VpnNatRuleMode.java | 47 + .../generated/models/VpnNatRuleType.java | 47 + .../VpnPacketCaptureStartParameters.java | 50 + .../VpnPacketCaptureStopParameters.java | 50 + .../models/VpnPolicyMemberAttributeType.java | 50 + .../generated/models/VpnProfileResponse.java | 24 + ...rverConfigRadiusClientRootCertificate.java | 76 + ...rverConfigRadiusServerRootCertificate.java | 76 + ...rverConfigVpnClientRevokedCertificate.java | 76 + ...nServerConfigVpnClientRootCertificate.java | 76 + .../models/VpnServerConfiguration.java | 481 + .../VpnServerConfigurationPolicyGroup.java | 267 + ...nServerConfigurationPolicyGroupMember.java | 102 + .../models/VpnServerConfigurations.java | 160 + ...nfigurationsAssociatedWithVirtualWans.java | 35 + .../VpnServerConfigurationsResponse.java | 26 + .../network/generated/models/VpnSite.java | 379 + .../network/generated/models/VpnSiteLink.java | 81 + .../models/VpnSiteLinkConnection.java | 174 + .../models/VpnSiteLinkConnections.java | 46 + .../generated/models/VpnSiteLinks.java | 65 + .../network/generated/models/VpnSites.java | 155 + .../models/VpnSitesConfigurations.java | 36 + .../network/generated/models/VpnType.java | 47 + .../models/WebApplicationFirewallAction.java | 50 + .../WebApplicationFirewallCustomRule.java | 225 + .../WebApplicationFirewallEnabledState.java | 47 + .../WebApplicationFirewallMatchVariable.java | 66 + .../models/WebApplicationFirewallMode.java | 47 + .../WebApplicationFirewallOperator.java | 77 + .../WebApplicationFirewallPolicies.java | 158 + .../models/WebApplicationFirewallPolicy.java | 333 + ...ebApplicationFirewallPolicyListResult.java | 62 + ...pplicationFirewallPolicyResourceState.java | 60 + .../WebApplicationFirewallRuleType.java | 47 + .../models/WebApplicationFirewallState.java | 47 + .../WebApplicationFirewallTransform.java | 62 + .../generated/models/WebCategories.java | 56 + .../generated/models/package-info.java | 6 + .../network/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + ...nRuleCollectionsCreateOrUpdateSamples.java | 35 + .../AdminRuleCollectionsDeleteSamples.java | 29 + .../AdminRuleCollectionsGetSamples.java | 28 + .../AdminRuleCollectionsListSamples.java | 23 + .../AdminRulesCreateOrUpdateSamples.java | 78 + .../generated/AdminRulesDeleteSamples.java | 29 + .../generated/AdminRulesGetSamples.java | 49 + .../generated/AdminRulesListSamples.java | 29 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + ...yPrivateEndpointConnectionsGetSamples.java | 23 + ...PrivateEndpointConnectionsListSamples.java | 21 + ...ivateEndpointConnectionsUpdateSamples.java | 36 + ...atewayPrivateLinkResourcesListSamples.java | 21 + ...yWafDynamicManifestsDefaultGetSamples.java | 22 + ...nGatewayWafDynamicManifestsGetSamples.java | 20 + ...nGatewaysBackendHealthOnDemandSamples.java | 43 + ...plicationGatewaysBackendHealthSamples.java | 20 + ...licationGatewaysCreateOrUpdateSamples.java | 362 + .../ApplicationGatewaysDeleteSamples.java | 20 + ...tionGatewaysGetByResourceGroupSamples.java | 20 + ...GatewaysGetSslPredefinedPolicySamples.java | 23 + ...aysListAvailableRequestHeadersSamples.java | 20 + ...ysListAvailableResponseHeadersSamples.java | 20 + ...ysListAvailableServerVariablesSamples.java | 20 + ...atewaysListAvailableSslOptionsSamples.java | 20 + ...AvailableSslPredefinedPoliciesSamples.java | 21 + ...tewaysListAvailableWafRuleSetsSamples.java | 20 + ...ionGatewaysListByResourceGroupSamples.java | 21 + .../ApplicationGatewaysListSamples.java | 21 + .../ApplicationGatewaysStartSamples.java | 20 + .../ApplicationGatewaysStopSamples.java | 20 + .../ApplicationGatewaysUpdateTagsSamples.java | 41 + ...onSecurityGroupsCreateOrUpdateSamples.java | 26 + ...pplicationSecurityGroupsDeleteSamples.java | 21 + ...curityGroupsGetByResourceGroupSamples.java | 22 + ...urityGroupsListByResourceGroupSamples.java | 21 + .../ApplicationSecurityGroupsListSamples.java | 21 + ...cationSecurityGroupsUpdateTagsSamples.java | 41 + .../AvailableDelegationsListSamples.java | 20 + .../AvailableEndpointServicesListSamples.java | 20 + ...dpointTypesListByResourceGroupSamples.java | 23 + ...ilablePrivateEndpointTypesListSamples.java | 21 + ...leResourceGroupDelegationsListSamples.java | 21 + ...viceAliasesListByResourceGroupSamples.java | 21 + .../AvailableServiceAliasesListSamples.java | 20 + .../AzureFirewallFqdnTagsListSamples.java | 21 + .../AzureFirewallsCreateOrUpdateSamples.java | 643 + .../AzureFirewallsDeleteSamples.java | 20 + ...ureFirewallsGetByResourceGroupSamples.java | 81 + ...reFirewallsListByResourceGroupSamples.java | 21 + ...reFirewallsListLearnedPrefixesSamples.java | 21 + .../generated/AzureFirewallsListSamples.java | 21 + .../AzureFirewallsUpdateTagsSamples.java | 40 + .../BastionHostsCreateOrUpdateSamples.java | 42 + .../generated/BastionHostsDeleteSamples.java | 20 + ...BastionHostsGetByResourceGroupSamples.java | 22 + ...astionHostsListByResourceGroupSamples.java | 21 + .../generated/BastionHostsListSamples.java | 21 + .../BastionHostsUpdateTagsSamples.java | 40 + .../BgpServiceCommunitiesListSamples.java | 20 + ...tionPolicyGroupsCreateOrUpdateSamples.java | 41 + ...onfigurationPolicyGroupsDeleteSamples.java | 23 + .../ConfigurationPolicyGroupsGetSamples.java | 22 + ...psListByVpnServerConfigurationSamples.java | 23 + ...nnectionMonitorsCreateOrUpdateSamples.java | 117 + .../ConnectionMonitorsDeleteSamples.java | 20 + .../ConnectionMonitorsGetSamples.java | 20 + .../ConnectionMonitorsListSamples.java | 20 + .../ConnectionMonitorsQuerySamples.java | 20 + .../ConnectionMonitorsStartSamples.java | 20 + .../ConnectionMonitorsStopSamples.java | 20 + .../ConnectionMonitorsUpdateTagsSamples.java | 40 + ...tyConfigurationsCreateOrUpdateSamples.java | 54 + ...nnectivityConfigurationsDeleteSamples.java | 28 + .../ConnectivityConfigurationsGetSamples.java | 24 + ...ConnectivityConfigurationsListSamples.java | 23 + ...CustomIpPrefixesCreateOrUpdateSamples.java | 27 + .../CustomIpPrefixesDeleteSamples.java | 20 + ...omIpPrefixesGetByResourceGroupSamples.java | 22 + ...mIpPrefixesListByResourceGroupSamples.java | 21 + .../CustomIpPrefixesListSamples.java | 20 + .../CustomIpPrefixesUpdateTagsSamples.java | 40 + ...osCustomPoliciesCreateOrUpdateSamples.java | 25 + .../DdosCustomPoliciesDeleteSamples.java | 20 + ...stomPoliciesGetByResourceGroupSamples.java | 22 + .../DdosCustomPoliciesUpdateTagsSamples.java | 40 + ...sProtectionPlansCreateOrUpdateSamples.java | 25 + .../DdosProtectionPlansDeleteSamples.java | 20 + ...tectionPlansGetByResourceGroupSamples.java | 22 + ...ectionPlansListByResourceGroupSamples.java | 21 + .../DdosProtectionPlansListSamples.java | 20 + .../DdosProtectionPlansUpdateTagsSamples.java | 41 + .../DefaultSecurityRulesGetSamples.java | 22 + .../DefaultSecurityRulesListSamples.java | 20 + ...scpConfigurationCreateOrUpdateSamples.java | 56 + .../DscpConfigurationDeleteSamples.java | 20 + ...onfigurationGetByResourceGroupSamples.java | 22 + ...nfigurationListByResourceGroupSamples.java | 20 + .../DscpConfigurationListSamples.java | 20 + ...itAuthorizationsCreateOrUpdateSamples.java | 25 + ...uteCircuitAuthorizationsDeleteSamples.java | 23 + ...sRouteCircuitAuthorizationsGetSamples.java | 23 + ...RouteCircuitAuthorizationsListSamples.java | 21 + ...rcuitConnectionsCreateOrUpdateSamples.java | 39 + ...sRouteCircuitConnectionsDeleteSamples.java | 27 + ...ressRouteCircuitConnectionsGetSamples.java | 28 + ...essRouteCircuitConnectionsListSamples.java | 23 + ...eCircuitPeeringsCreateOrUpdateSamples.java | 29 + ...ressRouteCircuitPeeringsDeleteSamples.java | 23 + ...ExpressRouteCircuitPeeringsGetSamples.java | 23 + ...xpressRouteCircuitPeeringsListSamples.java | 21 + ...essRouteCircuitsCreateOrUpdateSamples.java | 74 + .../ExpressRouteCircuitsDeleteSamples.java | 20 + ...outeCircuitsGetByResourceGroupSamples.java | 22 + ...ssRouteCircuitsGetPeeringStatsSamples.java | 23 + .../ExpressRouteCircuitsGetStatsSamples.java | 21 + ...pressRouteCircuitsListArpTableSamples.java | 22 + ...uteCircuitsListByResourceGroupSamples.java | 21 + ...ssRouteCircuitsListRoutesTableSamples.java | 22 + ...CircuitsListRoutesTableSummarySamples.java | 23 + .../ExpressRouteCircuitsListSamples.java | 21 + ...ExpressRouteCircuitsUpdateTagsSamples.java | 41 + ...RouteConnectionsCreateOrUpdateSamples.java | 73 + .../ExpressRouteConnectionsDeleteSamples.java | 23 + .../ExpressRouteConnectionsGetSamples.java | 23 + .../ExpressRouteConnectionsListSamples.java | 22 + ...nnectionPeeringsCreateOrUpdateSamples.java | 39 + ...eCrossConnectionPeeringsDeleteSamples.java | 27 + ...outeCrossConnectionPeeringsGetSamples.java | 27 + ...uteCrossConnectionPeeringsListSamples.java | 23 + ...CrossConnectionsCreateOrUpdateSamples.java | 29 + ...sConnectionsGetByResourceGroupSamples.java | 24 + ...teCrossConnectionsListArpTableSamples.java | 28 + ...ConnectionsListByResourceGroupSamples.java | 23 + ...rossConnectionsListRoutesTableSamples.java | 28 + ...nectionsListRoutesTableSummarySamples.java | 28 + ...pressRouteCrossConnectionsListSamples.java | 21 + ...outeCrossConnectionsUpdateTagsSamples.java | 42 + ...essRouteGatewaysCreateOrUpdateSamples.java | 37 + .../ExpressRouteGatewaysDeleteSamples.java | 22 + ...outeGatewaysGetByResourceGroupSamples.java | 23 + ...uteGatewaysListByResourceGroupSamples.java | 23 + ...outeGatewaysListBySubscriptionSamples.java | 21 + ...ExpressRouteGatewaysUpdateTagsSamples.java | 41 + .../ExpressRouteLinksGetSamples.java | 20 + .../ExpressRouteLinksListSamples.java | 20 + ...rtAuthorizationsCreateOrUpdateSamples.java | 25 + ...sRoutePortAuthorizationsDeleteSamples.java | 23 + ...ressRoutePortAuthorizationsGetSamples.java | 23 + ...essRoutePortAuthorizationsListSamples.java | 21 + ...xpressRoutePortsCreateOrUpdateSamples.java | 62 + .../ExpressRoutePortsDeleteSamples.java | 20 + .../ExpressRoutePortsGenerateLoaSamples.java | 28 + ...ssRoutePortsGetByResourceGroupSamples.java | 20 + ...sRoutePortsListByResourceGroupSamples.java | 21 + .../ExpressRoutePortsListSamples.java | 20 + .../ExpressRoutePortsLocationsGetSamples.java | 21 + ...ExpressRoutePortsLocationsListSamples.java | 21 + .../ExpressRoutePortsUpdateTagsSamples.java | 40 + ...RouteProviderPortsLocationListSamples.java | 21 + ...pressRouteServiceProvidersListSamples.java | 20 + ...FirewallPoliciesCreateOrUpdateSamples.java | 135 + .../FirewallPoliciesDeleteSamples.java | 20 + ...wallPoliciesGetByResourceGroupSamples.java | 22 + ...allPoliciesListByResourceGroupSamples.java | 21 + .../FirewallPoliciesListSamples.java | 21 + .../FirewallPoliciesUpdateTagsSamples.java | 41 + ...IdpsSignaturesFilterValuesListSamples.java | 28 + ...rewallPolicyIdpsSignaturesListSamples.java | 38 + ...licyIdpsSignaturesOverridesGetSamples.java | 22 + ...icyIdpsSignaturesOverridesListSamples.java | 22 + ...cyIdpsSignaturesOverridesPatchSamples.java | 48 + ...licyIdpsSignaturesOverridesPutSamples.java | 48 + ...CollectionGroupsCreateOrUpdateSamples.java | 183 + ...licyRuleCollectionGroupsDeleteSamples.java | 23 + ...lPolicyRuleCollectionGroupsGetSamples.java | 68 + ...PolicyRuleCollectionGroupsListSamples.java | 47 + .../FlowLogsCreateOrUpdateSamples.java | 34 + .../generated/FlowLogsDeleteSamples.java | 20 + .../generated/FlowLogsGetSamples.java | 20 + .../generated/FlowLogsListSamples.java | 20 + .../generated/FlowLogsUpdateTagsSamples.java | 37 + .../HubRouteTablesCreateOrUpdateSamples.java | 38 + .../HubRouteTablesDeleteSamples.java | 20 + .../generated/HubRouteTablesGetSamples.java | 22 + .../generated/HubRouteTablesListSamples.java | 20 + ...tworkConnectionsCreateOrUpdateSamples.java | 82 + ...irtualNetworkConnectionsDeleteSamples.java | 23 + ...ubVirtualNetworkConnectionsGetSamples.java | 23 + ...bVirtualNetworkConnectionsListSamples.java | 21 + .../InboundNatRulesCreateOrUpdateSamples.java | 37 + .../InboundNatRulesDeleteSamples.java | 20 + .../generated/InboundNatRulesGetSamples.java | 22 + .../generated/InboundNatRulesListSamples.java | 20 + ...ityRuleOperationCreateOrUpdateSamples.java | 36 + .../IpAllocationsCreateOrUpdateSamples.java | 46 + .../generated/IpAllocationsDeleteSamples.java | 20 + ...pAllocationsGetByResourceGroupSamples.java | 22 + ...AllocationsListByResourceGroupSamples.java | 21 + .../generated/IpAllocationsListSamples.java | 20 + .../IpAllocationsUpdateTagsSamples.java | 40 + .../IpGroupsCreateOrUpdateSamples.java | 42 + .../generated/IpGroupsDeleteSamples.java | 20 + .../IpGroupsGetByResourceGroupSamples.java | 22 + .../IpGroupsListByResourceGroupSamples.java | 20 + .../generated/IpGroupsListSamples.java | 20 + .../IpGroupsUpdateGroupsSamples.java | 40 + ...kendAddressPoolsCreateOrUpdateSamples.java | 50 + ...ancerBackendAddressPoolsDeleteSamples.java | 20 + ...BalancerBackendAddressPoolsGetSamples.java | 38 + ...alancerBackendAddressPoolsListSamples.java | 34 + ...cerFrontendIpConfigurationsGetSamples.java | 23 + ...erFrontendIpConfigurationsListSamples.java | 21 + ...dBalancerLoadBalancingRulesGetSamples.java | 23 + ...BalancerLoadBalancingRulesListSamples.java | 21 + ...dBalancerNetworkInterfacesListSamples.java | 34 + .../LoadBalancerOutboundRulesGetSamples.java | 20 + .../LoadBalancerOutboundRulesListSamples.java | 21 + .../LoadBalancerProbesGetSamples.java | 20 + .../LoadBalancerProbesListSamples.java | 20 + .../LoadBalancersCreateOrUpdateSamples.java | 737 + .../generated/LoadBalancersDeleteSamples.java | 20 + ...oadBalancersGetByResourceGroupSamples.java | 33 + ...adBalancersListByResourceGroupSamples.java | 21 + ...ListInboundNatRulePortMappingsSamples.java | 30 + .../generated/LoadBalancersListSamples.java | 20 + ...BalancersSwapPublicIpAddressesSamples.java | 48 + .../LoadBalancersUpdateTagsSamples.java | 40 + ...lNetworkGatewaysCreateOrUpdateSamples.java | 31 + .../LocalNetworkGatewaysDeleteSamples.java | 20 + ...workGatewaysGetByResourceGroupSamples.java | 22 + ...orkGatewaysListByResourceGroupSamples.java | 20 + ...LocalNetworkGatewaysUpdateTagsSamples.java | 41 + ...nagerConnectionsCreateOrUpdateSamples.java | 31 + ...etworkManagerConnectionsDeleteSamples.java | 24 + ...upNetworkManagerConnectionsGetSamples.java | 23 + ...pNetworkManagerConnectionsListSamples.java | 23 + .../NatGatewaysCreateOrUpdateSamples.java | 43 + .../generated/NatGatewaysDeleteSamples.java | 20 + .../NatGatewaysGetByResourceGroupSamples.java | 22 + ...NatGatewaysListByResourceGroupSamples.java | 21 + .../generated/NatGatewaysListSamples.java | 20 + .../NatGatewaysUpdateTagsSamples.java | 40 + .../NatRulesCreateOrUpdateSamples.java | 35 + .../generated/NatRulesDeleteSamples.java | 20 + .../generated/NatRulesGetSamples.java | 20 + .../NatRulesListByVpnGatewaySamples.java | 20 + .../NetworkGroupsCreateOrUpdateSamples.java | 25 + .../generated/NetworkGroupsDeleteSamples.java | 22 + .../generated/NetworkGroupsGetSamples.java | 22 + .../generated/NetworkGroupsListSamples.java | 20 + ...rkInterfaceIpConfigurationsGetSamples.java | 23 + ...kInterfaceIpConfigurationsListSamples.java | 21 + ...workInterfaceLoadBalancersListSamples.java | 21 + ...apConfigurationsCreateOrUpdateSamples.java | 31 + ...terfaceTapConfigurationsDeleteSamples.java | 22 + ...kInterfaceTapConfigurationsGetSamples.java | 23 + ...InterfaceTapConfigurationsListSamples.java | 21 + ...etworkInterfacesCreateOrUpdateSamples.java | 82 + .../NetworkInterfacesDeleteSamples.java | 20 + ...rkInterfacesGetByResourceGroupSamples.java | 22 + ...etCloudServiceNetworkInterfaceSamples.java | 24 + ...terfacesGetEffectiveRouteTableSamples.java | 21 + ...MachineScaleSetIpConfigurationSamples.java | 24 + ...achineScaleSetNetworkInterfaceSamples.java | 24 + ...kInterfacesListByResourceGroupSamples.java | 21 + ...tCloudServiceNetworkInterfacesSamples.java | 21 + ...eRoleInstanceNetworkInterfacesSamples.java | 24 + ...EffectiveNetworkSecurityGroupsSamples.java | 21 + .../NetworkInterfacesListSamples.java | 20 + ...achineScaleSetIpConfigurationsSamples.java | 24 + ...chineScaleSetNetworkInterfacesSamples.java | 23 + ...ineScaleSetVMNetworkInterfacesSamples.java | 23 + .../NetworkInterfacesUpdateTagsSamples.java | 40 + .../NetworkManagerCommitsPostSamples.java | 36 + ...rDeploymentStatusOperationListSamples.java | 36 + .../NetworkManagersCreateOrUpdateSamples.java | 35 + .../NetworkManagersDeleteSamples.java | 20 + ...workManagersGetByResourceGroupSamples.java | 22 + ...orkManagersListByResourceGroupSamples.java | 20 + .../generated/NetworkManagersListSamples.java | 20 + .../NetworkManagersPatchSamples.java | 40 + .../NetworkProfilesCreateOrUpdateSamples.java | 45 + .../NetworkProfilesDeleteSamples.java | 20 + ...workProfilesGetByResourceGroupSamples.java | 37 + ...orkProfilesListByResourceGroupSamples.java | 21 + .../generated/NetworkProfilesListSamples.java | 20 + .../NetworkProfilesUpdateTagsSamples.java | 40 + ...rkSecurityGroupsCreateOrUpdateSamples.java | 62 + .../NetworkSecurityGroupsDeleteSamples.java | 20 + ...curityGroupsGetByResourceGroupSamples.java | 22 + ...urityGroupsListByResourceGroupSamples.java | 21 + .../NetworkSecurityGroupsListSamples.java | 21 + ...etworkSecurityGroupsUpdateTagsSamples.java | 41 + ...irtualAppliancesCreateOrUpdateSamples.java | 91 + ...NetworkVirtualAppliancesDeleteSamples.java | 21 + ...alAppliancesGetByResourceGroupSamples.java | 22 + ...lAppliancesListByResourceGroupSamples.java | 21 + .../NetworkVirtualAppliancesListSamples.java | 21 + ...orkVirtualAppliancesUpdateTagsSamples.java | 41 + ...tworkWatchersCheckConnectivitySamples.java | 37 + .../NetworkWatchersCreateOrUpdateSamples.java | 20 + .../NetworkWatchersDeleteSamples.java | 20 + ...hersGetAzureReachabilityReportSamples.java | 37 + ...workWatchersGetByResourceGroupSamples.java | 20 + ...etworkWatchersGetFlowLogStatusSamples.java | 30 + ...NetworkConfigurationDiagnosticSamples.java | 43 + .../NetworkWatchersGetNextHopSamples.java | 34 + .../NetworkWatchersGetTopologySamples.java | 28 + ...tchersGetTroubleshootingResultSamples.java | 30 + ...workWatchersGetTroubleshootingSamples.java | 33 + ...workWatchersGetVMSecurityRulesSamples.java | 30 + ...WatchersListAvailableProvidersSamples.java | 33 + ...orkWatchersListByResourceGroupSamples.java | 20 + .../generated/NetworkWatchersListSamples.java | 20 + ...atchersSetFlowLogConfigurationSamples.java | 33 + .../NetworkWatchersUpdateTagsSamples.java | 40 + .../NetworkWatchersVerifyIpFlowSamples.java | 38 + .../generated/OperationsListSamples.java | 21 + .../P2SVpnGatewaysCreateOrUpdateSamples.java | 89 + .../P2SVpnGatewaysDeleteSamples.java | 20 + ...aysDisconnectP2SVpnConnectionsSamples.java | 30 + ...SVpnGatewaysGenerateVpnProfileSamples.java | 30 + ...SVpnGatewaysGetByResourceGroupSamples.java | 22 + ...P2SVpnConnectionHealthDetailedSamples.java | 33 + ...ewaysGetP2SVpnConnectionHealthSamples.java | 21 + ...VpnGatewaysListByResourceGroupSamples.java | 21 + .../generated/P2SVpnGatewaysListSamples.java | 21 + .../generated/P2SVpnGatewaysResetSamples.java | 20 + .../P2SVpnGatewaysUpdateTagsSamples.java | 40 + .../PacketCapturesCreateSamples.java | 51 + .../PacketCapturesDeleteSamples.java | 20 + .../generated/PacketCapturesGetSamples.java | 20 + .../PacketCapturesGetStatusSamples.java | 20 + .../generated/PacketCapturesListSamples.java | 20 + .../generated/PacketCapturesStopSamples.java | 20 + ...ressRouteCircuitConnectionsGetSamples.java | 28 + ...essRouteCircuitConnectionsListSamples.java | 23 + ...ateDnsZoneGroupsCreateOrUpdateSamples.java | 37 + .../PrivateDnsZoneGroupsDeleteSamples.java | 20 + .../PrivateDnsZoneGroupsGetSamples.java | 22 + .../PrivateDnsZoneGroupsListSamples.java | 21 + ...PrivateEndpointsCreateOrUpdateSamples.java | 127 + .../PrivateEndpointsDeleteSamples.java | 20 + ...ateEndpointsGetByResourceGroupSamples.java | 52 + ...teEndpointsListByResourceGroupSamples.java | 21 + .../PrivateEndpointsListSamples.java | 20 + ...rviceVisibilityByResourceGroupSamples.java | 30 + ...ckPrivateLinkServiceVisibilitySamples.java | 29 + ...vateLinkServicesCreateOrUpdateSamples.java | 59 + ...eletePrivateEndpointConnectionSamples.java | 23 + .../PrivateLinkServicesDeleteSamples.java | 20 + ...LinkServicesGetByResourceGroupSamples.java | 22 + ...esGetPrivateEndpointConnectionSamples.java | 24 + ...ateLinkServicesByResourceGroupSamples.java | 23 + ...utoApprovedPrivateLinkServicesSamples.java | 23 + ...inkServicesListByResourceGroupSamples.java | 21 + ...ListPrivateEndpointConnectionsSamples.java | 23 + .../PrivateLinkServicesListSamples.java | 20 + ...pdatePrivateEndpointConnectionSamples.java | 36 + ...ublicIpAddressesCreateOrUpdateSamples.java | 71 + ...pAddressesDdosProtectionStatusSamples.java | 21 + .../PublicIpAddressesDeleteSamples.java | 20 + ...cIpAddressesGetByResourceGroupSamples.java | 22 + ...GetCloudServicePublicIpAddressSamples.java | 23 + ...MachineScaleSetPublicIpAddressSamples.java | 23 + ...IpAddressesListByResourceGroupSamples.java | 21 + ...tCloudServicePublicIpAddressesSamples.java | 22 + ...eRoleInstancePublicIpAddressesSamples.java | 23 + .../PublicIpAddressesListSamples.java | 20 + ...chineScaleSetPublicIpAddressesSamples.java | 22 + ...ineScaleSetVMPublicIpAddressesSamples.java | 23 + .../PublicIpAddressesUpdateTagsSamples.java | 40 + ...PublicIpPrefixesCreateOrUpdateSamples.java | 57 + .../PublicIpPrefixesDeleteSamples.java | 20 + ...icIpPrefixesGetByResourceGroupSamples.java | 22 + ...cIpPrefixesListByResourceGroupSamples.java | 21 + .../PublicIpPrefixesListSamples.java | 20 + .../PublicIpPrefixesUpdateTagsSamples.java | 40 + .../ResourceNavigationLinksListSamples.java | 20 + ...oviderCheckDnsNameAvailabilitySamples.java | 22 + ...iderDeleteBastionShareableLinkSamples.java | 45 + ...oviderDisconnectActiveSessionsSamples.java | 25 + ...oviderExpressRouteProviderPortSamples.java | 20 + ...nserverconfigurationvpnprofileSamples.java | 33 + ...ourceProviderGetActiveSessionsSamples.java | 21 + ...roviderGetBastionShareableLinkSamples.java | 45 + ...tiveConnectivityConfigurationsSamples.java | 33 + ...erListActiveSecurityAdminRulesSamples.java | 33 + ...tiveConnectivityConfigurationsSamples.java | 30 + ...gerEffectiveSecurityAdminRulesSamples.java | 30 + ...roviderPutBastionShareableLinkSamples.java | 45 + ...iderSupportedSecurityProvidersSamples.java | 22 + ...RouteFilterRulesCreateOrUpdateSamples.java | 35 + .../RouteFilterRulesDeleteSamples.java | 20 + .../generated/RouteFilterRulesGetSamples.java | 20 + ...teFilterRulesListByRouteFilterSamples.java | 21 + .../RouteFiltersCreateOrUpdateSamples.java | 52 + .../generated/RouteFiltersDeleteSamples.java | 20 + ...RouteFiltersGetByResourceGroupSamples.java | 22 + ...outeFiltersListByResourceGroupSamples.java | 21 + .../generated/RouteFiltersListSamples.java | 20 + .../RouteFiltersUpdateTagsSamples.java | 40 + .../RouteMapsCreateOrUpdateSamples.java | 64 + .../generated/RouteMapsDeleteSamples.java | 20 + .../generated/RouteMapsGetSamples.java | 20 + .../generated/RouteMapsListSamples.java | 20 + .../RouteTablesCreateOrUpdateSamples.java | 49 + .../generated/RouteTablesDeleteSamples.java | 20 + .../RouteTablesGetByResourceGroupSamples.java | 20 + ...RouteTablesListByResourceGroupSamples.java | 21 + .../generated/RouteTablesListSamples.java | 20 + .../RouteTablesUpdateTagsSamples.java | 40 + .../RoutesCreateOrUpdateSamples.java | 28 + .../generated/RoutesDeleteSamples.java | 20 + .../generated/generated/RoutesGetSamples.java | 20 + .../generated/RoutesListSamples.java | 20 + .../RoutingIntentCreateOrUpdateSamples.java | 40 + .../generated/RoutingIntentDeleteSamples.java | 20 + .../generated/RoutingIntentGetSamples.java | 20 + .../generated/RoutingIntentListSamples.java | 20 + ...ScopeConnectionsCreateOrUpdateSamples.java | 28 + .../ScopeConnectionsDeleteSamples.java | 23 + .../generated/ScopeConnectionsGetSamples.java | 23 + .../ScopeConnectionsListSamples.java | 21 + ...inConfigurationsCreateOrUpdateSamples.java | 30 + ...urityAdminConfigurationsDeleteSamples.java | 23 + ...SecurityAdminConfigurationsGetSamples.java | 23 + ...ecurityAdminConfigurationsListSamples.java | 23 + ...PartnerProvidersCreateOrUpdateSamples.java | 47 + ...SecurityPartnerProvidersDeleteSamples.java | 21 + ...nerProvidersGetByResourceGroupSamples.java | 22 + ...erProvidersListByResourceGroupSamples.java | 21 + .../SecurityPartnerProvidersListSamples.java | 21 + ...rityPartnerProvidersUpdateTagsSamples.java | 41 + .../SecurityRulesCreateOrUpdateSamples.java | 36 + .../generated/SecurityRulesDeleteSamples.java | 21 + .../generated/SecurityRulesGetSamples.java | 21 + .../generated/SecurityRulesListSamples.java | 21 + .../ServiceAssociationLinksListSamples.java | 20 + ...EndpointPoliciesCreateOrUpdateSamples.java | 59 + .../ServiceEndpointPoliciesDeleteSamples.java | 20 + ...ointPoliciesGetByResourceGroupSamples.java | 22 + ...intPoliciesListByResourceGroupSamples.java | 21 + .../ServiceEndpointPoliciesListSamples.java | 21 + ...viceEndpointPoliciesUpdateTagsSamples.java | 42 + ...olicyDefinitionsCreateOrUpdateSamples.java | 35 + ...ndpointPolicyDefinitionsDeleteSamples.java | 23 + ...ceEndpointPolicyDefinitionsGetSamples.java | 23 + ...DefinitionsListByResourceGroupSamples.java | 23 + .../ServiceTagInformationListSamples.java | 46 + .../generated/ServiceTagsListSamples.java | 20 + .../StaticMembersCreateOrUpdateSamples.java | 26 + .../generated/StaticMembersDeleteSamples.java | 23 + .../generated/StaticMembersGetSamples.java | 23 + .../generated/StaticMembersListSamples.java | 22 + .../SubnetsCreateOrUpdateSamples.java | 64 + .../generated/SubnetsDeleteSamples.java | 20 + .../generated/SubnetsGetSamples.java | 32 + .../generated/SubnetsListSamples.java | 20 + .../SubnetsPrepareNetworkPoliciesSamples.java | 29 + ...ubnetsUnprepareNetworkPoliciesSamples.java | 29 + ...nagerConnectionsCreateOrUpdateSamples.java | 26 + ...etworkManagerConnectionsDeleteSamples.java | 23 + ...onNetworkManagerConnectionsGetSamples.java | 23 + ...nNetworkManagerConnectionsListSamples.java | 21 + .../generated/UsagesListSamples.java | 32 + .../generated/VipSwapCreateSamples.java | 30 + .../generated/VipSwapGetSamples.java | 20 + .../generated/VipSwapListSamples.java | 20 + ...alApplianceSitesCreateOrUpdateSamples.java | 33 + .../VirtualApplianceSitesDeleteSamples.java | 21 + .../VirtualApplianceSitesGetSamples.java | 21 + .../VirtualApplianceSitesListSamples.java | 21 + .../VirtualApplianceSkusGetSamples.java | 21 + .../VirtualApplianceSkusListSamples.java | 21 + ...ubBgpConnectionsCreateOrUpdateSamples.java | 32 + ...VirtualHubBgpConnectionsDeleteSamples.java | 21 + .../VirtualHubBgpConnectionsGetSamples.java | 21 + ...onnectionsListAdvertisedRoutesSamples.java | 23 + ...gpConnectionsListLearnedRoutesSamples.java | 23 + .../VirtualHubBgpConnectionsListSamples.java | 20 + ...bIpConfigurationCreateOrUpdateSamples.java | 31 + ...irtualHubIpConfigurationDeleteSamples.java | 21 + .../VirtualHubIpConfigurationGetSamples.java | 23 + .../VirtualHubIpConfigurationListSamples.java | 20 + ...HubRouteTableV2SCreateOrUpdateSamples.java | 45 + .../VirtualHubRouteTableV2SDeleteSamples.java | 23 + .../VirtualHubRouteTableV2SGetSamples.java | 23 + .../VirtualHubRouteTableV2SListSamples.java | 20 + .../VirtualHubsCreateOrUpdateSamples.java | 47 + .../generated/VirtualHubsDeleteSamples.java | 20 + .../VirtualHubsGetByResourceGroupSamples.java | 20 + ...bsGetEffectiveVirtualHubRoutesSamples.java | 69 + .../VirtualHubsGetInboundRoutesSamples.java | 32 + .../VirtualHubsGetOutboundRoutesSamples.java | 32 + ...VirtualHubsListByResourceGroupSamples.java | 21 + .../generated/VirtualHubsListSamples.java | 20 + .../VirtualHubsUpdateTagsSamples.java | 40 + ...tewayConnectionsCreateOrUpdateSamples.java | 130 + ...etworkGatewayConnectionsDeleteSamples.java | 21 + ...yConnectionsGetByResourceGroupSamples.java | 23 + ...orkGatewayConnectionsGetIkeSasSamples.java | 21 + ...GatewayConnectionsGetSharedKeySamples.java | 23 + ...ConnectionsListByResourceGroupSamples.java | 21 + ...ewayConnectionsResetConnectionSamples.java | 21 + ...tewayConnectionsResetSharedKeySamples.java | 29 + ...GatewayConnectionsSetSharedKeySamples.java | 29 + ...yConnectionsStartPacketCaptureSamples.java | 49 + ...ayConnectionsStopPacketCaptureSamples.java | 31 + ...rkGatewayConnectionsUpdateTagsSamples.java | 41 + ...kGatewayNatRulesCreateOrUpdateSamples.java | 38 + ...alNetworkGatewayNatRulesDeleteSamples.java | 21 + ...rtualNetworkGatewayNatRulesGetSamples.java | 23 + ...lesListByVirtualNetworkGatewaySamples.java | 23 + ...lNetworkGatewaysCreateOrUpdateSamples.java | 110 + .../VirtualNetworkGatewaysDeleteSamples.java | 20 + ...alNetworkGatewayVpnConnectionsSamples.java | 30 + ...workGatewaysGenerateVpnProfileSamples.java | 25 + ...tewaysGeneratevpnclientpackageSamples.java | 24 + ...orkGatewaysGetAdvertisedRoutesSamples.java | 21 + ...etworkGatewaysGetBgpPeerStatusSamples.java | 21 + ...workGatewaysGetByResourceGroupSamples.java | 22 + ...etworkGatewaysGetLearnedRoutesSamples.java | 21 + ...atewaysGetVpnProfilePackageUrlSamples.java | 21 + ...ysGetVpnclientConnectionHealthSamples.java | 23 + ...aysGetVpnclientIpsecParametersSamples.java | 21 + ...orkGatewaysListByResourceGroupSamples.java | 21 + ...NetworkGatewaysListConnectionsSamples.java | 23 + .../VirtualNetworkGatewaysResetSamples.java | 20 + ...atewaysResetVpnClientSharedKeySamples.java | 20 + ...aysSetVpnclientIpsecParametersSamples.java | 43 + ...workGatewaysStartPacketCaptureSamples.java | 47 + ...tworkGatewaysStopPacketCaptureSamples.java | 31 + ...orkGatewaysSupportedVpnDevicesSamples.java | 23 + ...rtualNetworkGatewaysUpdateTagsSamples.java | 41 + ...ysVpnDeviceConfigurationScriptSamples.java | 32 + ...lNetworkPeeringsCreateOrUpdateSamples.java | 85 + .../VirtualNetworkPeeringsDeleteSamples.java | 20 + .../VirtualNetworkPeeringsGetSamples.java | 33 + .../VirtualNetworkPeeringsListSamples.java | 33 + ...rtualNetworkTapsCreateOrUpdateSamples.java | 31 + .../VirtualNetworkTapsDeleteSamples.java | 21 + ...lNetworkTapsGetByResourceGroupSamples.java | 22 + ...NetworkTapsListByResourceGroupSamples.java | 21 + .../VirtualNetworkTapsListSamples.java | 20 + .../VirtualNetworkTapsUpdateTagsSamples.java | 40 + ...orksCheckIpAddressAvailabilitySamples.java | 22 + .../VirtualNetworksCreateOrUpdateSamples.java | 218 + .../VirtualNetworksDeleteSamples.java | 20 + ...tualNetworksGetByResourceGroupSamples.java | 52 + ...ualNetworksListByResourceGroupSamples.java | 21 + ...tworksListDdosProtectionStatusSamples.java | 23 + .../generated/VirtualNetworksListSamples.java | 20 + .../VirtualNetworksListUsageSamples.java | 20 + .../VirtualNetworksUpdateTagsSamples.java | 40 + ...alRouterPeeringsCreateOrUpdateSamples.java | 26 + .../VirtualRouterPeeringsDeleteSamples.java | 20 + .../VirtualRouterPeeringsGetSamples.java | 22 + .../VirtualRouterPeeringsListSamples.java | 21 + .../VirtualRoutersCreateOrUpdateSamples.java | 45 + .../VirtualRoutersDeleteSamples.java | 20 + ...rtualRoutersGetByResourceGroupSamples.java | 22 + ...tualRoutersListByResourceGroupSamples.java | 21 + .../generated/VirtualRoutersListSamples.java | 21 + .../VirtualWansCreateOrUpdateSamples.java | 42 + .../generated/VirtualWansDeleteSamples.java | 20 + .../VirtualWansGetByResourceGroupSamples.java | 20 + ...VirtualWansListByResourceGroupSamples.java | 21 + .../generated/VirtualWansListSamples.java | 20 + .../VirtualWansUpdateTagsSamples.java | 40 + .../VpnConnectionsCreateOrUpdateSamples.java | 84 + .../VpnConnectionsDeleteSamples.java | 20 + .../generated/VpnConnectionsGetSamples.java | 20 + ...VpnConnectionsListByVpnGatewaySamples.java | 20 + ...nConnectionsStartPacketCaptureSamples.java | 58 + ...pnConnectionsStopPacketCaptureSamples.java | 34 + .../VpnGatewaysCreateOrUpdateSamples.java | 109 + .../generated/VpnGatewaysDeleteSamples.java | 20 + .../VpnGatewaysGetByResourceGroupSamples.java | 20 + ...VpnGatewaysListByResourceGroupSamples.java | 21 + .../generated/VpnGatewaysListSamples.java | 21 + .../generated/VpnGatewaysResetSamples.java | 20 + .../VpnGatewaysStartPacketCaptureSamples.java | 47 + .../VpnGatewaysStopPacketCaptureSamples.java | 31 + .../VpnGatewaysUpdateTagsSamples.java | 40 + .../VpnLinkConnectionsGetIkeSasSamples.java | 22 + ...ConnectionsListByVpnConnectionSamples.java | 22 + ...LinkConnectionsResetConnectionSamples.java | 22 + ...nsAssociatedWithVirtualWanListSamples.java | 23 + ...erConfigurationsCreateOrUpdateSamples.java | 133 + .../VpnServerConfigurationsDeleteSamples.java | 21 + ...nfigurationsGetByResourceGroupSamples.java | 22 + ...figurationsListByResourceGroupSamples.java | 21 + .../VpnServerConfigurationsListSamples.java | 20 + ...ServerConfigurationsUpdateTagsSamples.java | 41 + .../VpnSiteLinkConnectionsGetSamples.java | 22 + .../generated/VpnSiteLinksGetSamples.java | 20 + .../VpnSiteLinksListByVpnSiteSamples.java | 20 + .../VpnSitesConfigurationDownloadSamples.java | 35 + .../VpnSitesCreateOrUpdateSamples.java | 71 + .../generated/VpnSitesDeleteSamples.java | 20 + .../VpnSitesGetByResourceGroupSamples.java | 20 + .../VpnSitesListByResourceGroupSamples.java | 20 + .../generated/VpnSitesListSamples.java | 20 + .../generated/VpnSitesUpdateTagsSamples.java | 40 + ...FirewallPoliciesCreateOrUpdateSamples.java | 164 + ...licationFirewallPoliciesDeleteSamples.java | 21 + ...wallPoliciesGetByResourceGroupSamples.java | 23 + ...allPoliciesListByResourceGroupSamples.java | 21 + ...pplicationFirewallPoliciesListSamples.java | 21 + .../generated/WebCategoriesGetSamples.java | 20 + .../generated/WebCategoriesListSamples.java | 21 + sdk/network/ci.yml | 47 + sdk/network/pom.xml | 15 + 2591 files changed, 478153 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/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/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/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/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/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/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/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/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/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/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/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/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/NetworkVirtualApplianceInner.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/PeerRouteListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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/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/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/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/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/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/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/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/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/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/NetworkVirtualApplianceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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/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/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/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/Utils.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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/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/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/ApplicationGatewayFirewallRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/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/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/AzureFirewallFqdnTag.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/BastionHostSkuName.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/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/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/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/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/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/FirewallPolicies.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/FirewallPolicyIntrusionDetectionProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/GroupConnectivity.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/InboundSecurityRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/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/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/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/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/NetworkVirtualApplianceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextStep.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/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/PeerRouteList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/VpnLinkConnectionsResetConnectionSamples.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 e15f48326ba0b..c5ea79ae85da9 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -397,6 +397,7 @@ com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;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-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 2c7336bffde95..7225893d99d22 100644 --- a/pom.xml +++ b/pom.xml @@ -119,6 +119,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/network sdk/networkfunction sdk/nginx sdk/notificationhubs 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..16d02ed23e832 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-02-22) + +- Azure Resource Manager Network client library for Java. This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2022-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/network/azure-resourcemanager-network-generated/README.md b/sdk/network/azure-resourcemanager-network-generated/README.md new file mode 100644 index 0000000000000..b32e75acb1f85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/README.md @@ -0,0 +1,105 @@ +# 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-2022-09. 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 + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +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://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md new file mode 100644 index 0000000000000..c0b37ebeae829 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md @@ -0,0 +1,20124 @@ +# 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) +- [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) + +## FirewallPolicyIdpsSignatures + +- [List](#firewallpolicyidpssignatures_list) + +## FirewallPolicyIdpsSignaturesFilterValues + +- [List](#firewallpolicyidpssignaturesfiltervalues_list) + +## FirewallPolicyIdpsSignaturesOverrides + +- [Get](#firewallpolicyidpssignaturesoverrides_get) +- [List](#firewallpolicyidpssignaturesoverrides_list) +- [Patch](#firewallpolicyidpssignaturesoverrides_patch) +- [Put](#firewallpolicyidpssignaturesoverrides_put) + +## 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) + +## 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) +- [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) + +## 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) + +## NetworkVirtualAppliances + +- [CreateOrUpdate](#networkvirtualappliances_createorupdate) +- [Delete](#networkvirtualappliances_delete) +- [GetByResourceGroup](#networkvirtualappliances_getbyresourcegroup) +- [List](#networkvirtualappliances_list) +- [ListByResourceGroup](#networkvirtualappliances_listbyresourcegroup) +- [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) +- [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) + +## 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) + +## 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 + +- [GetIkeSas](#vpnlinkconnections_getikesas) +- [ListByVpnConnection](#vpnlinkconnections_listbyvpnconnection) +- [ResetConnection](#vpnlinkconnections_resetconnection) + +## 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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.ApplicationGatewayLoadDistributionAlgorithm; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule; +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.ApplicationGatewayUrlPathMap; +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/2022-09-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(), + new ApplicationGatewayBackendAddress())))) + .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)))) + .withUrlPathMaps( + Arrays + .asList( + new ApplicationGatewayUrlPathMap() + .withName("pathMap1") + .withDefaultBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")) + .withDefaultBackendHttpSettings( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs")) + .withDefaultRewriteRuleSet( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")) + .withDefaultLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")) + .withPathRules( + Arrays + .asList( + new ApplicationGatewayPathRule() + .withName("apiPaths") + .withPaths(Arrays.asList("/api", "/v1/api")) + .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")) + .withRewriteRuleSet( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")) + .withLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")))))) + .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")) + .withLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")), + new ApplicationGatewayRequestRoutingRule() + .withName("appgwPathBasedRule") + .withRuleType(ApplicationGatewayRequestRoutingRuleType.PATH_BASED_ROUTING) + .withPriority(20) + .withHttpListener( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener")) + .withUrlPathMap( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1")))) + .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"))))))) + .withLoadDistributionPolicies( + Arrays + .asList( + new ApplicationGatewayLoadDistributionPolicy() + .withName("ldp1") + .withLoadDistributionTargets( + Arrays + .asList( + new ApplicationGatewayLoadDistributionTarget() + .withName("ld11") + .withWeightPerServer(40) + .withBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")), + new ApplicationGatewayLoadDistributionTarget() + .withName("ld11") + .withWeightPerServer(60) + .withBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1")))) + .withLoadDistributionAlgorithm(ApplicationGatewayLoadDistributionAlgorithm.ROUND_ROBIN))) + .withGlobalConfiguration( + new ApplicationGatewayGlobalConfiguration() + .withEnableRequestBuffering(true) + .withEnableResponseBuffering(true)) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList("1", "2", "3")) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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", "value1", "key2", "value2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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", "value1")) + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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_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/2022-09-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(); + } + + @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 java.util.Arrays; + +/** Samples for BastionHosts CreateOrUpdate. */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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(); + } +} +``` + +### BastionHosts_Delete + +```java +/** Samples for BastionHosts Delete. */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.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 java.util.Arrays; + +/** Samples for ConnectionMonitors CreateOrUpdate. */ +public final class ConnectionMonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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") + .create(); + } +} +``` + +### ExpressRouteCircuits_Delete + +```java +/** Samples for ExpressRouteCircuits Delete. */ +public final class ExpressRouteCircuitsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.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/2022-09-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", "value1")) + .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) + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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; + } +} +``` + +### 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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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); + } + + @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/2022-09-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); + } + + @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; + } +} +``` + +### 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.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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup. + * + * @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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup With IpGroups. + * + * @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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup 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/2022-09-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json + */ + /** + * Sample code: Create FirewallPolicyNatRuleCollectionGroup. + * + * @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(); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_Delete + +```java +/** Samples for FirewallPolicyRuleCollectionGroups Delete. */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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; + +/** Samples for FlowLogs CreateOrUpdate. */ +public final class FlowLogsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe") + .withEnabled(true) + .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1)) + .create(); + } +} +``` + +### FlowLogs_Delete + +```java +/** Samples for FlowLogs Delete. */ +public final class FlowLogsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.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/2022-09-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") + .withRules( + Arrays + .asList( + new InboundSecurityRules() + .withProtocol(InboundSecurityRulesProtocol.TCP) + .withSourceAddressPrefix("50.20.121.5/32") + .withDestinationPortRange(22))) + .create(); + } +} +``` + +### 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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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", "value1")) + .withIpAddresses(Arrays.asList("13.64.39.16/32", "40.74.146.80/31", "40.74.147.32/28")) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.TransportProtocol; +import java.util.Arrays; + +/** Samples for LoadBalancers CreateOrUpdate. */ +public final class LoadBalancersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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.fromString("Premium"))) + .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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.fromString("Premium"))) + .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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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_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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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 +/** Samples for NetworkGroups CreateOrUpdate. */ +public final class NetworkGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .create(); + } +} +``` + +### NetworkGroups_Delete + +```java +/** Samples for NetworkGroups Delete. */ +public final class NetworkGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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("rg1", "test-networkinterface", "test-tapconfiguration", 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/2022-09-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/2022-09-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("rg1", "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/2022-09-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/2022-09-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")))) + .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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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); + } +} +``` + +### 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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +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 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/2022-09-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", "value1")) + .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/2022-09-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", "value1")) + .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) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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_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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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; + +/** Samples for NetworkWatchers SetFlowLogConfiguration. */ +public final class NetworkWatchersSetFlowLogConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withEnabled(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### 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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.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/2022-09-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/2022-09-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/2022-09-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(); + } +} +``` + +### PublicIpAddresses_DdosProtectionStatus + +```java +/** Samples for PublicIpAddresses DdosProtectionStatus. */ +public final class PublicIpAddressesDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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_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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withRules( + Arrays + .asList( + new RouteFilterRuleInner() + .withName("ruleName") + .withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")))) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")).apply(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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); + } +} +``` + +### ScopeConnections_CreateOrUpdate + +```java +/** Samples for ScopeConnections CreateOrUpdate. */ +public final class ScopeConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withSecurityProviderName(SecurityProviderName.ZSCALER) + .withVirtualHub( + new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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); + } +} +``` + +### ServiceAssociationLinks_List + +```java +/** Samples for ServiceAssociationLinks List. */ +public final class ServiceAssociationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.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/2022-09-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/2022-09-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/2022-09-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(); + } +} +``` + +### Subnets_Delete + +```java +/** Samples for Subnets Delete. */ +public final class SubnetsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withVirtualWan( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1")) + .withAddressPrefix("10.168.0.0/24") + .withSku("Basic") + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } +} +``` + +### VirtualNetworkGateways_Delete + +```java +/** Samples for VirtualNetworkGateways Delete. */ +public final class VirtualNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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); + } +} +``` + +### VirtualNetworkGateways_GetLearnedRoutes + +```java +/** Samples for VirtualNetworkGateways GetLearnedRoutes. */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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; + +/** Samples for VirtualNetworkPeerings CreateOrUpdate. */ +public final class VirtualNetworkPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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(); + } +} +``` + +### VirtualNetworkPeerings_Delete + +```java +/** Samples for VirtualNetworkPeerings Delete. */ +public final class VirtualNetworkPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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); + } +} +``` + +### VirtualNetworkPeerings_List + +```java +/** Samples for VirtualNetworkPeerings List. */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withHostedGateway( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway")) + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .withDisableVpnEncryption(false) + .withTypePropertiesType("Basic") + .create(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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(); + } + + @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_GetIkeSas + +```java +/** Samples for VpnLinkConnections GetIkeSas. */ +public final class VpnLinkConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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_ResetConnection + +```java +/** Samples for VpnLinkConnections ResetConnection. */ +public final class VpnLinkConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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); + } +} +``` + +### 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/2022-09-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", "value1")) + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1")) + .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(); + } + + @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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/2022-09-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.ExclusionManagedRule; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleGroup; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleSet; +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.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 java.util.Arrays; + +/** Samples for WebApplicationFirewallPolicies CreateOrUpdate. */ +public final class WebApplicationFirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .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))) + .withManagedRules( + new ManagedRulesDefinition() + .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)))))))) + .create(); + } +} +``` + +### WebApplicationFirewallPolicies_Delete + +```java +/** Samples for WebApplicationFirewallPolicies Delete. */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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..dd9bf1bcff80b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/pom.xml @@ -0,0 +1,61 @@ + + + 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-2022-09. + 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 + + + + com.azure + azure-core + 1.36.0 + + + com.azure + azure-core-management + 1.10.1 + + + 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..520241a93482e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java @@ -0,0 +1,2436 @@ +// Copyright (c) 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.FirewallPolicyIdpsSignaturesFilterValuesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesOverridesImpl; +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.NetworkManagersImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkProfilesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkVirtualAppliancesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkWatchersImpl; +import com.azure.resourcemanager.network.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.network.generated.implementation.P2SVpnGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.PacketCapturesImpl; +import com.azure.resourcemanager.network.generated.implementation.PeerExpressRouteCircuitConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateDnsZoneGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateEndpointsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateLinkServicesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpAddressesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpPrefixesImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceNavigationLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFilterRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFiltersImpl; +import com.azure.resourcemanager.network.generated.implementation.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.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.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.FirewallPolicyIdpsSignatures; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesFilterValues; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesOverrides; +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.NetworkManagers; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; +import com.azure.resourcemanager.network.generated.models.NetworkWatchers; +import com.azure.resourcemanager.network.generated.models.Operations; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateways; +import com.azure.resourcemanager.network.generated.models.PacketCaptures; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoints; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServices; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks; +import com.azure.resourcemanager.network.generated.models.ResourceProviders; +import com.azure.resourcemanager.network.generated.models.RouteFilterRules; +import com.azure.resourcemanager.network.generated.models.RouteFilters; +import com.azure.resourcemanager.network.generated.models.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.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.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 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 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 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 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 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 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; + } + + /** + * @return Wrapped service client NetworkManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public NetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/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..be6dada237655 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRuleCollectionsClient.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.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..09871ec05490d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRulesClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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..783f82ae070d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +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< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..31f249c89f5c2 --- /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..144f3c839bff0 --- /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..519ca9e3c4e34 --- /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..11aaca37ed936 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java @@ -0,0 +1,660 @@ +// Copyright (c) Microsoft 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..74001eeb851dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */ +public interface ApplicationSecurityGroupsClient { + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..8acb755128eaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.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.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..4ec1759a59e09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.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.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..018eef577ebb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */ +public interface AvailablePrivateEndpointTypesClient { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types 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..1c40fd31ad1a2 --- /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..ae2b9bb62dc5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +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..f147838633f67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; + +/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ +public interface AzureFirewallFqdnTagsClient { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription 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..84600da33add2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.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.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.fluent.models.IpPrefixesListInner; +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); +} 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..dad61ade4861c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.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; + +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..89f338fb0250f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; + +/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ +public interface BgpServiceCommunitiesClient { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities 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..8f1faaf4eae48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConfigurationPolicyGroupsClient.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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..82ba5f228a866 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.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.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..5591d63072311 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectivityConfigurationsClient.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; + +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..a38b8e0638831 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in CustomIpPrefixesClient. */ +public interface CustomIpPrefixesClient { + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..f5c74f54cce32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DdosCustomPoliciesClient. */ +public interface DdosCustomPoliciesClient { + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..205c6536cf439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DdosProtectionPlansClient. */ +public interface DdosProtectionPlansClient { + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..d0ee35cf07436 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ +public interface DefaultSecurityRulesClient { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group 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..73e19aece8c0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.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.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..7874ea3f28753 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCircuitAuthorizationsClient. + */ +public interface ExpressRouteCircuitAuthorizationsClient { + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..6672f25fa99d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.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.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..4bcaa429b8e1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitPeeringsClient. */ +public interface ExpressRouteCircuitPeeringsClient { + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..d13b3a6213453 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft 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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..be31f91a0e9d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ +public interface ExpressRouteConnectionsClient { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..70ab943102d69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. + */ +public interface ExpressRouteCrossConnectionPeeringsClient { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection 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..70e0cc1f67c2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.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; + +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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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(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< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java new file mode 100644 index 0000000000000..0a0f91f57050f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ +public interface ExpressRouteGatewaysClient { + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..2b7830fa23e16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ +public interface ExpressRouteLinksClient { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..3a3c2cab533fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortAuthorizationsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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..8cb837ea61ce4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsClient. */ +public interface ExpressRoutePortsClient { + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..98cc2ffe9b84a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ +public interface ExpressRoutePortsLocationsClient { + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ea8b58014ec30 --- /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..d86afbd2fec7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ +public interface ExpressRouteServiceProvidersClient { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers 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..3f97558be3d32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.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.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/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..62558fe5adca6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesClient.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.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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..2ff019fb63795 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesFilterValuesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +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 Describes the filter values possibles for a given column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Describes the filter values possibles for a given column. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..68cf2a036e654 --- /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/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..7a9f410bfb3c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.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; + +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..b3cc1867fc72c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in FlowLogsClient. */ +public interface FlowLogsClient { + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..083fe47c6b3e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.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.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..21f24c27f570e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.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.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..941c27ae95090 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; + +/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ +public interface InboundNatRulesClient { + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer 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..9f1ac5352438d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in InboundSecurityRuleOperationsClient. */ +public interface InboundSecurityRuleOperationsClient { + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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); +} 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..2c2e779766fcb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in IpAllocationsClient. */ +public interface IpAllocationsClient { + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..0828731d8d18e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in IpGroupsClient. */ +public interface IpGroupsClient { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @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..c2a0961dcb5cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ +public interface LoadBalancerBackendAddressPoolsClient { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools 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..3693c18872654 --- /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..7a301f6dd9d89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ +public interface LoadBalancerLoadBalancingRulesClient { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer 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..84484b07108d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ +public interface LoadBalancerNetworkInterfacesClient { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces 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..de130bf3cc5b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ +public interface LoadBalancerOutboundRulesClient { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer 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..8d6ebd074fb91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ +public interface LoadBalancerProbesClient { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes 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..205c2e8a4329c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.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; + +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.models.LoadBalancerVipSwapRequest; +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); +} 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..a65edddf19e7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ +public interface LocalNetworkGatewaysClient { + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..88129a88d8d13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ManagementGroupNetworkManagerConnectionsClient.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; + +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..b68885229b583 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NatGatewaysClient. */ +public interface NatGatewaysClient { + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..15798ddb0fd14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.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.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..84041e228239b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkGroupsClient.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; + +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..90044ee1cafce --- /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..24b53d61eae27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; + +/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ +public interface NetworkInterfaceLoadBalancersClient { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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..5e5f39a58c881 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceTapConfigurationsClient. + */ +public interface NetworkInterfaceTapConfigurationsClient { + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..ee1dc78c77ccf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java @@ -0,0 +1,653 @@ +// Copyright (c) Microsoft 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..41ee50bef81be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.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.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 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 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 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..5417ff981998e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerCommitsClient.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.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..966eda8940b90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerDeploymentStatusOperationsClient.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +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/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..1f9698f5f1457 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagersClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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..669ffa09e76c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public interface NetworkProfilesClient { + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..e786cbf5f6cb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkSecurityGroupsClient. */ +public interface NetworkSecurityGroupsClient { + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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/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..cfa0592e4d7d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in NetworkVirtualAppliancesClient. */ +public interface NetworkVirtualAppliancesClient { + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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); + + /** + * 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..da675c7416be6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java @@ -0,0 +1,997 @@ +// Copyright (c) Microsoft 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..edb05e2c4f46e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Network Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations 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..f15a0076d26a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.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; + +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..e0bf7c0713b53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; + +/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ +public interface PacketCapturesClient { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..c343ad52587c1 --- /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..55cfee526a174 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; + +/** An instance of this class provides access to all the operations defined in PrivateDnsZoneGroupsClient. */ +public interface PrivateDnsZoneGroupsClient { + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..ec9238c7b9472 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointsClient. */ +public interface PrivateEndpointsClient { + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..96c04ed30abe4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java @@ -0,0 +1,594 @@ +// Copyright (c) Microsoft 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..f81cd1a71f1cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java @@ -0,0 +1,553 @@ +// Copyright (c) Microsoft 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..d45c3f96f3aa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PublicIpPrefixesClient. */ +public interface PublicIpPrefixesClient { + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..cb6a97a2ec982 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ResourceNavigationLinksClient. */ +public interface ResourceNavigationLinksClient { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..c20fcd093b189 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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..0af9ff62f4471 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; + +/** An instance of this class provides access to all the operations defined in RouteFilterRulesClient. */ +public interface RouteFilterRulesClient { + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..1095251460185 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in RouteFiltersClient. */ +public interface RouteFiltersClient { + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..1da5b1663079f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteMapsClient.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.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..b8a3ae2ca2485 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in RouteTablesClient. */ +public interface RouteTablesClient { + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..84004529d606c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; + +/** An instance of this class provides access to all the operations defined in RoutesClient. */ +public interface RoutesClient { + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..feb2b75ac4b72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingIntentsClient.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.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/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..02861cb395e9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ScopeConnectionsClient.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.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..157b6b2c6d869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityAdminConfigurationsClient.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; + +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..573e39ca06bc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.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.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..cc6ec39062af9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in SecurityRulesClient. */ +public interface SecurityRulesClient { + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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/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..33d4ee2e898a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceAssociationLinksClient. */ +public interface ServiceAssociationLinksClient { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..3077255508cdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ServiceEndpointPoliciesClient. */ +public interface ServiceEndpointPoliciesClient { + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..6b52498438017 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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..a6ee21489b2af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagInformationsClient.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.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..b8d03f5646a91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceTagsClient. */ +public interface ServiceTagsClient { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..1bc1b9fd5414a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/StaticMembersClient.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; + +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..0b2a77a686096 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; + +/** An instance of this class provides access to all the operations defined in SubnetsClient. */ +public interface SubnetsClient { + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..0f7ea7b36d5bc --- /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..d7ad7dbec90ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response 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..a694f4f84d107 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VipSwapsClient.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; + +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..990dd2d059e63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.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.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..cd19cfa225b1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.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.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..edcbb0d023345 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; + +/** An instance of this class provides access to all the operations defined in VirtualHubBgpConnectionsClient. */ +public interface VirtualHubBgpConnectionsClient { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listLearnedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerRouteListInner listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java new file mode 100644 index 0000000000000..ddb75ede3dbd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; + +/** An instance of this class provides access to all the operations defined in VirtualHubIpConfigurationsClient. */ +public interface VirtualHubIpConfigurationsClient { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..babe9d369b95d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.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.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..fce8e2a1d28f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.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, Void> 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, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * 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, Void> 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, Void> 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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, Void> 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, Void> 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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..278c74398c47a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java @@ -0,0 +1,719 @@ +// Copyright (c) Microsoft 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..78399c4164ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.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.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..4380f58df1436 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java @@ -0,0 +1,1255 @@ +// Copyright (c) Microsoft 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< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnClientConnectionHealthDetailListResultInner getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..8243ed52a1641 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.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; + +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..7a8da785c484f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkTapsClient. */ +public interface VirtualNetworkTapsClient { + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..1b9ff0614e83c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.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.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..e7f18a5377a93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; + +/** An instance of this class provides access to all the operations defined in VirtualRouterPeeringsClient. */ +public interface VirtualRouterPeeringsClient { + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..aa74b3cca1341 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; + +/** An instance of this class provides access to all the operations defined in VirtualRoutersClient. */ +public interface VirtualRoutersClient { + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..eb57d3bf44a7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ +public interface VirtualWansClient { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..4a21520122167 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.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.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..ba16b1070a280 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.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; + +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..dd685733c2cc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; + +/** An instance of this class provides access to all the operations defined in VpnLinkConnectionsClient. */ +public interface VpnLinkConnectionsClient { + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 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..a71ec55c989c6 --- /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..3b23328606635 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.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.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..022aa09c4c328 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinkConnectionsClient. */ +public interface VpnSiteLinkConnectionsClient { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..19c0821855936 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinksClient. */ +public interface VpnSiteLinksClient { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..af99b9a713fb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ +public interface VpnSitesClient { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..ed0a3bacb40d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; + +/** An instance of this class provides access to all the operations defined in VpnSitesConfigurationsClient. */ +public interface VpnSitesConfigurationsClient { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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..1b7c48493ce18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.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; + +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..621508000b64f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; + +/** An instance of this class provides access to all the operations defined in WebCategoriesClient. */ +public interface WebCategoriesClient { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @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..a4eabb412319a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveConnectivityConfigurationsListResultInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ActiveConnectivityConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of active connectivity configurations. + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "skipToken") + 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()); + } + } +} 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..955ed50be4227 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveSecurityAdminRulesListResultInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ActiveBaseSecurityAdminRule; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of active security admin rules. + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "skipToken") + 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()); + } + } +} 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..4cb91d41b8aff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminPropertiesFormat.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security admin rule resource. */ +@Fluent +public final class AdminPropertiesFormat { + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Network protocol this rule applies to. + */ + @JsonProperty(value = "protocol", required = true) + private SecurityConfigurationRuleProtocol protocol; + + /* + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "sources") + private List sources; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "destinations") + private List destinations; + + /* + * The source port ranges. + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * Indicates the access allowed for this particular rule + */ + @JsonProperty(value = "access", required = true) + 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. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Indicates if the traffic matched against the rule in inbound or outbound. + */ + @JsonProperty(value = "direction", required = true) + private SecurityConfigurationRuleDirection direction; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER + .logExceptionAsError( + 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property access in model AdminPropertiesFormat")); + } + if (direction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property direction in model AdminPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdminPropertiesFormat.class); +} 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..e6e513808f4c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionInner.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.core.management.SystemData; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private AdminRuleCollectionPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..fdac042a4eac4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionPropertiesFormat.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the admin rule collection properties. */ +@Fluent +public final class AdminRuleCollectionPropertiesFormat { + /* + * A description of the admin rule collection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Groups for configuration + */ + @JsonProperty(value = "appliesToGroups", required = true) + private List appliesToGroups; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appliesToGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appliesToGroups in model AdminRuleCollectionPropertiesFormat")); + } else { + appliesToGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdminRuleCollectionPropertiesFormat.class); +} 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..133bd1f880e13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificatePropertiesFormat { + /* + * Certificate public data. + */ + @JsonProperty(value = "data") + private String data; + + /* + * The provisioning state of the authentication certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..4a7cf6ad9bba4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.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.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..20b965672c39d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ApplicationGatewayAvailableSslOptions. */ +@Fluent +public final class ApplicationGatewayAvailableSslOptionsPropertiesFormat { + /* + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "predefinedPolicies") + private List predefinedPolicies; + + /* + * Name of the Ssl predefined policy applied by default to application gateway. + */ + @JsonProperty(value = "defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /* + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "availableCipherSuites") + private List availableCipherSuites; + + /* + * List of available Ssl protocols. + */ + @JsonProperty(value = "availableProtocols") + 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() { + } +} 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..60d76ecec7c36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableWafRuleSets API service call. */ +@Fluent +public final class ApplicationGatewayAvailableWafRuleSetsResultInner { + /* + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..4e6b036b3c252 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.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.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Backend Address Pool of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddressPoolPropertiesFormat { + /* + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIpConfigurations; + + /* + * Backend addresses. + */ + @JsonProperty(value = "backendAddresses") + private List backendAddresses; + + /* + * The provisioning state of the backend address pool resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..51480052c718a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayBackendHealth API service call. */ +@Fluent +public final class ApplicationGatewayBackendHealthInner { + /* + * A list of ApplicationGatewayBackendHealthPool resources. + */ + @JsonProperty(value = "backendAddressPools") + 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()); + } + } +} 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..dda69ba7041e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of on demand test probe. */ +@Fluent +public final class ApplicationGatewayBackendHealthOnDemandInner { + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * Application gateway BackendHealthHttp settings. + */ + @JsonProperty(value = "backendHealthHttpSettings") + 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(); + } + } +} 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..42588cc350300 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application gateway backendhealth http settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthServerInner { + /* + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Reference to IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIpConfigurationInner ipConfiguration; + + /* + * Health of backend server. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /* + * Health Probe Log. + */ + @JsonProperty(value = "healthProbeLog") + private String healthProbeLog; + + /** 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(); + } + } +} 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..310a7710107a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Backend address pool settings of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendHttpSettingsPropertiesFormat { + /* + * The destination port on the backend. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The protocol used to communicate with the backend. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Cookie based affinity. + */ + @JsonProperty(value = "cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /* + * Request timeout in seconds. Application Gateway will fail the request if response is not received within + * RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + */ + @JsonProperty(value = "requestTimeout") + private Integer requestTimeout; + + /* + * Probe resource of an application gateway. + */ + @JsonProperty(value = "probe") + private SubResource probe; + + /* + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "authenticationCertificates") + private List authenticationCertificates; + + /* + * Array of references to application gateway trusted root certificates. + */ + @JsonProperty(value = "trustedRootCertificates") + private List trustedRootCertificates; + + /* + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /* + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * Whether to pick host header should be picked from the host name of the backend server. Default value is false. + */ + @JsonProperty(value = "pickHostNameFromBackendAddress") + private Boolean pickHostnameFromBackendAddress; + + /* + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "affinityCookieName") + private String affinityCookieName; + + /* + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "probeEnabled") + private Boolean probeEnabled; + + /* + * Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value + * is null. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The provisioning state of the backend HTTP settings resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..bfa1c08fc0986 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendSettingsPropertiesFormat.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Backend address pool settings of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendSettingsPropertiesFormat { + /* + * The destination port on the backend. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The protocol used to communicate with the backend. + */ + @JsonProperty(value = "protocol") + 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. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * Probe resource of an application gateway. + */ + @JsonProperty(value = "probe") + private SubResource probe; + + /* + * Array of references to application gateway trusted root certificates. + */ + @JsonProperty(value = "trustedRootCertificates") + private List trustedRootCertificates; + + /* + * Server name indication to be sent to the backend servers for Tls protocol. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value + * is false. + */ + @JsonProperty(value = "pickHostNameFromBackendAddress") + private Boolean pickHostnameFromBackendAddress; + + /* + * The provisioning state of the backend HTTP settings resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..8021232e4f967 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the web application firewall rule set. */ +@Fluent +public final class ApplicationGatewayFirewallRuleSetPropertiesFormat { + /* + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "ruleGroups", required = true) + private List ruleGroups; + + /* + * Tier of an application gateway that support the rule set. + */ + @JsonProperty(value = "tiers") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model" + + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetVersion in model" + + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } + if (ruleGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroups in model" + + " ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } else { + ruleGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(ApplicationGatewayFirewallRuleSetPropertiesFormat.class); +} 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..1f470a328e225 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Frontend IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendIpConfigurationPropertiesFormat { + /* + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * Reference to the PublicIP resource. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /* + * Reference to the application gateway private link configuration. + */ + @JsonProperty(value = "privateLinkConfiguration") + private SubResource privateLinkConfiguration; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..f367af9fa8681 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Frontend port of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendPortPropertiesFormat { + /* + * Frontend port. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The provisioning state of the frontend port resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..b2f6e0aaf6067 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of HTTP listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayHttpListenerPropertiesFormat { + /* + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "frontendPort") + private SubResource frontendPort; + + /* + * Protocol of the HTTP listener. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name of HTTP listener. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "sslCertificate") + private SubResource sslCertificate; + + /* + * SSL profile resource of the application gateway. + */ + @JsonProperty(value = "sslProfile") + private SubResource sslProfile; + + /* + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "requireServerNameIndication") + private Boolean requireServerNameIndication; + + /* + * The provisioning state of the HTTP listener resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the HTTP listener. + */ + @JsonProperty(value = "customErrorConfigurations") + private List customErrorConfigurations; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "firewallPolicy") + private SubResource firewallPolicy; + + /* + * List of Host names for HTTP Listener that allows special wildcard characters as well. + */ + @JsonProperty(value = "hostNames") + 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()); + } + } +} 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..049ab389effd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java @@ -0,0 +1,1010 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlPathMap; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Application gateway resource. */ +@Fluent +public final class ApplicationGatewayInner extends Resource { + /* + * Properties of the application gateway. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The identity of the application gateway, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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; + } + + /** + * 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(); + } + } +} 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..ef752c34e5c7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayIpConfigurationPropertiesFormat { + /* + * Reference to the subnet resource. A subnet from where application gateway gets its private address. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The provisioning state of the application gateway IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..0317c3675d6cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayListenerPropertiesFormat.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayListenerPropertiesFormat { + /* + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "frontendPort") + private SubResource frontendPort; + + /* + * Protocol of the listener. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "sslCertificate") + private SubResource sslCertificate; + + /* + * SSL profile resource of the application gateway. + */ + @JsonProperty(value = "sslProfile") + private SubResource sslProfile; + + /* + * The provisioning state of the listener resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..ee8f69e168803 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.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.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionAlgorithm; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Load Distribution Policy of an application gateway. */ +@Fluent +public final class ApplicationGatewayLoadDistributionPolicyPropertiesFormat { + /* + * Load Distribution Targets resource of an application gateway. + */ + @JsonProperty(value = "loadDistributionTargets") + private List loadDistributionTargets; + + /* + * Load Distribution Targets resource of an application gateway. + */ + @JsonProperty(value = "loadDistributionAlgorithm") + private ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm; + + /* + * The provisioning state of the Load Distribution Policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..ddd2597a940bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationGatewayLoadDistributionTargetPropertiesFormat model. */ +@Fluent +public final class ApplicationGatewayLoadDistributionTargetPropertiesFormat { + /* + * Weight per server. Range between 1 and 100. + */ + @JsonProperty(value = "weightPerServer") + private Integer weightPerServer; + + /* + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "backendAddressPool") + 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() { + } +} 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..ba4aa1370fab6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPathRulePropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of path rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayPathRulePropertiesFormat { + /* + * Path rules of URL path map. + */ + @JsonProperty(value = "paths") + private List paths; + + /* + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "backendHttpSettings") + private SubResource backendHttpSettings; + + /* + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "redirectConfiguration") + private SubResource redirectConfiguration; + + /* + * Rewrite rule set resource of URL path map path rule. + */ + @JsonProperty(value = "rewriteRuleSet") + private SubResource rewriteRuleSet; + + /* + * Load Distribution Policy resource of URL path map path rule. + */ + @JsonProperty(value = "loadDistributionPolicy") + private SubResource loadDistributionPolicy; + + /* + * The provisioning state of the path rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "firewallPolicy") + 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() { + } +} 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..db25fa534b5a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private Endpoint connection on an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionInner extends SubResource { + /* + * Properties of the application gateway private endpoint connection. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerProperties; + + /* + * Name of the private endpoint connection on an application gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..ca36292528a11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Private Link Resource of an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionPropertiesInner { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the application gateway private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + @JsonProperty(value = "linkIdentifier", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..4634698ee202b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of private link configuration on an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateLinkConfigurationProperties { + /* + * An array of application gateway private link ip configurations. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * The provisioning state of the application gateway private link configuration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..1b0c4c49d08f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an application gateway private link IP configuration. */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfigurationProperties { + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * Whether the ip configuration is primary or not. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The provisioning state of the application gateway private link IP configuration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..8fab1aba52543 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPrivateLinkResourceProperties innerProperties; + + /* + * Name of the private link resource that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..b8955ec10e85f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceProperties { + /* + * Group identifier of private link resource. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Required member names of private link resource. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "requiredZoneNames") + 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() { + } +} 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..36c39f812977d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.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.resourcemanager.network.generated.models.ApplicationGatewayProbeHealthResponseMatch; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of probe of an application gateway. */ +@Fluent +public final class ApplicationGatewayProbePropertiesFormat { + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "interval") + private Integer interval; + + /* + * The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. + * Acceptable values are from 1 second to 86400 seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * The probe retry count. Backend server is marked down after consecutive probe failure count reaches + * UnhealthyThreshold. Acceptable values are from 1 second to 20. + */ + @JsonProperty(value = "unhealthyThreshold") + private Integer unhealthyThreshold; + + /* + * Whether the host header should be picked from the backend http settings. Default value is false. + */ + @JsonProperty(value = "pickHostNameFromBackendHttpSettings") + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is + * false. + */ + @JsonProperty(value = "pickHostNameFromBackendSettings") + private Boolean pickHostnameFromBackendSettings; + + /* + * Minimum number of servers that are always marked healthy. Default value is 0. + */ + @JsonProperty(value = "minServers") + private Integer minServers; + + /* + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * The provisioning state of the probe resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case + * not set, port from http settings will be used. This property is valid for Standard_v2 and WAF_v2 only. + */ + @JsonProperty(value = "port") + 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 Standard_v2 + * and WAF_v2 only. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Custom port which will be used for probing the backend servers. The valid value ranges + * from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 + * and WAF_v2 only. + * + * @param port the port value to set. + * @return the 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(); + } + } +} 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..507f467e5b199 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.java @@ -0,0 +1,1100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the application gateway. */ +@Fluent +public final class ApplicationGatewayPropertiesFormat { + /* + * SKU of the application gateway resource. + */ + @JsonProperty(value = "sku") + private ApplicationGatewaySku sku; + + /* + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Operational state of the application gateway resource. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /* + * Subnets of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "gatewayIPConfigurations") + private List gatewayIpConfigurations; + + /* + * Authentication certificates of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "authenticationCertificates") + private List authenticationCertificates; + + /* + * Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "trustedRootCertificates") + private List trustedRootCertificates; + + /* + * Trusted client certificates of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "trustedClientCertificates") + private List trustedClientCertificates; + + /* + * SSL certificates of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "sslCertificates") + private List sslCertificates; + + /* + * Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * Frontend ports of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "frontendPorts") + private List frontendPorts; + + /* + * Probes of the application gateway resource. + */ + @JsonProperty(value = "probes") + private List probes; + + /* + * Backend address pool of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /* + * Backend http settings of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "backendHttpSettingsCollection") + 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). + */ + @JsonProperty(value = "backendSettingsCollection") + 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). + */ + @JsonProperty(value = "httpListeners") + 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). + */ + @JsonProperty(value = "listeners") + 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). + */ + @JsonProperty(value = "sslProfiles") + private List sslProfiles; + + /* + * URL path map of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "urlPathMaps") + private List urlPathMaps; + + /* + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "requestRoutingRules") + private List requestRoutingRules; + + /* + * Routing rules of the application gateway resource. + */ + @JsonProperty(value = "routingRules") + private List routingRules; + + /* + * Rewrite rules for the application gateway resource. + */ + @JsonProperty(value = "rewriteRuleSets") + private List rewriteRuleSets; + + /* + * Redirect configurations of the application gateway resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "redirectConfigurations") + private List redirectConfigurations; + + /* + * Web application firewall configuration. + */ + @JsonProperty(value = "webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /* + * Reference to the FirewallPolicy resource. + */ + @JsonProperty(value = "firewallPolicy") + private SubResource firewallPolicy; + + /* + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "enableHttp2") + private Boolean enableHttp2; + + /* + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "enableFips") + private Boolean enableFips; + + /* + * Autoscale Configuration. + */ + @JsonProperty(value = "autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /* + * PrivateLink configurations on application gateway. + */ + @JsonProperty(value = "privateLinkConfigurations") + private List privateLinkConfigurations; + + /* + * Private Endpoint connections on application gateway. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the application gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the application gateway resource. + */ + @JsonProperty(value = "customErrorConfigurations") + private List customErrorConfigurations; + + /* + * If true, associates a firewall policy with an application gateway regardless whether the policy differs from the + * WAF Config. + */ + @JsonProperty(value = "forceFirewallPolicyAssociation") + private Boolean forceFirewallPolicyAssociation; + + /* + * Load distribution policies of the application gateway resource. + */ + @JsonProperty(value = "loadDistributionPolicies") + private List loadDistributionPolicies; + + /* + * Global Configuration. + */ + @JsonProperty(value = "globalConfiguration") + private ApplicationGatewayGlobalConfiguration globalConfiguration; + + /** 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; + } + + /** + * 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(); + } + } +} 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..729aae348a993 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.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.resourcemanager.network.generated.models.ApplicationGatewayRedirectType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of redirect configuration of the application gateway. */ +@Fluent +public final class ApplicationGatewayRedirectConfigurationPropertiesFormat { + /* + * HTTP redirection type. + */ + @JsonProperty(value = "redirectType") + private ApplicationGatewayRedirectType redirectType; + + /* + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "targetListener") + private SubResource targetListener; + + /* + * Url to redirect the request to. + */ + @JsonProperty(value = "targetUrl") + private String targetUrl; + + /* + * Include path in the redirected url. + */ + @JsonProperty(value = "includePath") + private Boolean includePath; + + /* + * Include query string in the redirected url. + */ + @JsonProperty(value = "includeQueryString") + private Boolean includeQueryString; + + /* + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "requestRoutingRules") + private List requestRoutingRules; + + /* + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "urlPathMaps") + private List urlPathMaps; + + /* + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "pathRules") + 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() { + } +} 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..c8943d3fd8cfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of request routing rule of the application gateway. */ +@Fluent +public final class ApplicationGatewayRequestRoutingRulePropertiesFormat { + /* + * Rule type. + */ + @JsonProperty(value = "ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /* + * Priority of the request routing rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "backendHttpSettings") + private SubResource backendHttpSettings; + + /* + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "httpListener") + private SubResource httpListener; + + /* + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "urlPathMap") + private SubResource urlPathMap; + + /* + * Rewrite Rule Set resource in Basic rule of the application gateway. + */ + @JsonProperty(value = "rewriteRuleSet") + private SubResource rewriteRuleSet; + + /* + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "redirectConfiguration") + private SubResource redirectConfiguration; + + /* + * Load Distribution Policy resource of the application gateway. + */ + @JsonProperty(value = "loadDistributionPolicy") + private SubResource loadDistributionPolicy; + + /* + * The provisioning state of the request routing rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..1926464361de6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of rewrite rule set of the application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleSetPropertiesFormat { + /* + * Rewrite rules in the rewrite rule set. + */ + @JsonProperty(value = "rewriteRules") + private List rewriteRules; + + /* + * The provisioning state of the rewrite rule set resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..0eeb6bdbba1df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRoutingRulePropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of routing rule of the application gateway. */ +@Fluent +public final class ApplicationGatewayRoutingRulePropertiesFormat { + /* + * Rule type. + */ + @JsonProperty(value = "ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /* + * Priority of the routing rule. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Backend settings resource of the application gateway. + */ + @JsonProperty(value = "backendSettings") + private SubResource backendSettings; + + /* + * Listener resource of the application gateway. + */ + @JsonProperty(value = "listener") + private SubResource listener; + + /* + * The provisioning state of the request routing rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..7988a3d95e1e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of SSL certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslCertificatePropertiesFormat { + /* + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "data") + private String data; + + /* + * Password for the pfx file specified in data. Only applicable in PUT request. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + */ + @JsonProperty(value = "publicCertData", access = JsonProperty.Access.WRITE_ONLY) + private String publicCertData; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /* + * The provisioning state of the SSL certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..6370e42d1177f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An Ssl predefined policy. */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /* + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties of the application gateway SSL predefined policy. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..b4ac82fb6050f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ApplicationGatewaySslPredefinedPolicy. */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyPropertiesFormat { + /* + * Ssl cipher suites to be enabled in the specified order for application gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** 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() { + } +} 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..983fef1a7ca5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of SSL profile of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslProfilePropertiesFormat { + /* + * Array of references to application gateway trusted client certificates. + */ + @JsonProperty(value = "trustedClientCertificates") + private List trustedClientCertificates; + + /* + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Client authentication configuration of the application gateway resource. + */ + @JsonProperty(value = "clientAuthConfiguration") + private ApplicationGatewayClientAuthConfiguration clientAuthConfiguration; + + /* + * The provisioning state of the HTTP listener resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..8f7b6f041dda9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted client certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificatePropertiesFormat { + /* + * Certificate public data. + */ + @JsonProperty(value = "data") + private String data; + + /* + * Validated certificate data. + */ + @JsonProperty(value = "validatedCertData", access = JsonProperty.Access.WRITE_ONLY) + private String validatedCertData; + + /* + * Distinguished name of client certificate issuer. + */ + @JsonProperty(value = "clientCertIssuerDN", access = JsonProperty.Access.WRITE_ONLY) + private String clientCertIssuerDN; + + /* + * The provisioning state of the trusted client certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..2d16bf7c4b054 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificatePropertiesFormat { + /* + * Certificate public data. + */ + @JsonProperty(value = "data") + private String data; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /* + * The provisioning state of the trusted root certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..be37a9c0bbf49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of UrlPathMap of the application gateway. */ +@Fluent +public final class ApplicationGatewayUrlPathMapPropertiesFormat { + /* + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /* + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /* + * Default Rewrite rule set resource of URL path map. + */ + @JsonProperty(value = "defaultRewriteRuleSet") + private SubResource defaultRewriteRuleSet; + + /* + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /* + * Default Load Distribution Policy resource of URL path map. + */ + @JsonProperty(value = "defaultLoadDistributionPolicy") + private SubResource defaultLoadDistributionPolicy; + + /* + * Path rule of URL path map resource. + */ + @JsonProperty(value = "pathRules") + private List pathRules; + + /* + * The provisioning state of the URL path map resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..1d794c29b3bae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestPropertiesResult.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallManifestRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ApplicationGatewayWafDynamicManifest. */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestPropertiesResult { + /* + * The default ruleset. + */ + @JsonProperty(value = "defaultRuleSet") + private DefaultRuleSetPropertyFormat innerDefaultRuleSet; + + /* + * The available rulesets. + */ + @JsonProperty(value = "availableRuleSets") + 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()); + } + } +} 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..91e564cb43b4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallManifestRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayWafDynamicManifest API service call. */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestResultInner { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Properties of the ApplicationGatewayWafDynamicManifest . + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..8904bc13c9beb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationSecurityGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..add68e57b2ad1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application security group properties. */ +@Immutable +public final class ApplicationSecurityGroupPropertiesFormat { + /* + * The resource GUID property of the application security group resource. It uniquely identifies a resource, even + * if the user changes its name or migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the application security group resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..54f345acbd228 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AuthorizationPropertiesFormat.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.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of ExpressRouteCircuitAuthorization. */ +@Fluent +public final class AuthorizationPropertiesFormat { + /* + * The authorization key. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * The authorization use status. + */ + @JsonProperty(value = "authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /* + * The provisioning state of the authorization resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 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() { + } +} 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..fd307752981d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information of an AutoApprovedPrivateLinkService. */ +@Fluent +public final class AutoApprovedPrivateLinkServiceInner { + /* + * The id of the private link service resource. + */ + @JsonProperty(value = "privateLinkService") + 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() { + } +} 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..52824b8e3e83e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. */ +@Fluent +public final class AvailableDelegationInner { + /* + * The name of the AvailableDelegation resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailableDelegation resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions") + private List actions; + + /** 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() { + } +} 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..8f481377b123e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information of an AvailablePrivateEndpointType. */ +@Fluent +public final class AvailablePrivateEndpointTypeInner { + /* + * The name of the service and resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailablePrivateEndpoint Type resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * Display name of the resource. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** 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() { + } +} 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..7e7794e2fe8f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of available countries with details. */ +@Fluent +public final class AvailableProvidersListInner { + /* + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property countries in model AvailableProvidersListInner")); + } else { + countries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableProvidersListInner.class); +} 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..ba4761eb3c9ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available service alias. */ +@Fluent +public final class AvailableServiceAliasInner { + /* + * The name of the service alias. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the service alias. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The resource name of the service alias. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /** 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() { + } +} 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..12ffb11f4f60c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.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.resourcemanager.network.generated.models.AzureFirewallApplicationRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the application rule collection. */ +@Fluent +public final class AzureFirewallApplicationRuleCollectionPropertiesFormat { + /* + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The action type of a rule collection. + */ + @JsonProperty(value = "action") + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The provisioning state of the application rule collection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..1d93035133c41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Azure Firewall FQDN Tag Resource. */ +@Fluent +public final class AzureFirewallFqdnTagInner extends Resource { + /* + * Properties of the azure firewall FQDN tag. + */ + @JsonProperty(value = "properties") + private AzureFirewallFqdnTagPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..eaa29bde7201c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Firewall FQDN Tag Properties. */ +@Immutable +public final class AzureFirewallFqdnTagPropertiesFormat { + /* + * The provisioning state of the Azure firewall FQDN tag resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The name of this FQDN Tag. + */ + @JsonProperty(value = "fqdnTagName", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..a2ca6aeeb2b66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Firewall resource. */ +@Fluent +public final class AzureFirewallInner extends Resource { + /* + * Properties of the azure firewall. + */ + @JsonProperty(value = "properties") + private AzureFirewallPropertiesFormat innerProperties; + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..dfe8e3af7d36e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an Azure Firewall. */ +@Fluent +public final class AzureFirewallIpConfigurationPropertiesFormat { + /* + * The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + */ + @JsonProperty(value = "privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or + * 'AzureFirewallManagementSubnet'. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /* + * The provisioning state of the Azure firewall IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..cc8151fd3f9f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNatRuleCollectionProperties.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.resourcemanager.network.generated.models.AzureFirewallNatRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the NAT rule collection. */ +@Fluent +public final class AzureFirewallNatRuleCollectionProperties { + /* + * Priority of the NAT rule collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The action type of a NAT rule collection. + */ + @JsonProperty(value = "action") + private AzureFirewallNatRCAction action; + + /* + * Collection of rules used by a NAT rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The provisioning state of the NAT rule collection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..21e59a4aae7dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.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.resourcemanager.network.generated.models.AzureFirewallNetworkRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the network rule collection. */ +@Fluent +public final class AzureFirewallNetworkRuleCollectionPropertiesFormat { + /* + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The action type of a rule collection. + */ + @JsonProperty(value = "action") + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The provisioning state of the network rule collection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..27a36ea8b3ea6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties of the Azure Firewall. */ +@Fluent +public final class AzureFirewallPropertiesFormat { + /* + * Collection of application rule collections used by Azure Firewall. + */ + @JsonProperty(value = "applicationRuleCollections") + private List applicationRuleCollections; + + /* + * Collection of NAT rule collections used by Azure Firewall. + */ + @JsonProperty(value = "natRuleCollections") + private List natRuleCollections; + + /* + * Collection of network rule collections used by Azure Firewall. + */ + @JsonProperty(value = "networkRuleCollections") + private List networkRuleCollections; + + /* + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * IP configuration of the Azure Firewall used for management traffic. + */ + @JsonProperty(value = "managementIpConfiguration") + private AzureFirewallIpConfiguration managementIpConfiguration; + + /* + * The provisioning state of the Azure firewall resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The operation mode for Threat Intelligence. + */ + @JsonProperty(value = "threatIntelMode") + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * The virtualHub to which the firewall belongs. + */ + @JsonProperty(value = "virtualHub") + private SubResource virtualHub; + + /* + * The firewallPolicy associated with this azure firewall. + */ + @JsonProperty(value = "firewallPolicy") + private SubResource firewallPolicy; + + /* + * IP addresses associated with AzureFirewall. + */ + @JsonProperty(value = "hubIPAddresses") + private HubIpAddresses hubIpAddresses; + + /* + * IpGroups associated with AzureFirewall. + */ + @JsonProperty(value = "ipGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ipGroups; + + /* + * The Azure Firewall Resource SKU. + */ + @JsonProperty(value = "sku") + private AzureFirewallSku sku; + + /* + * The additional properties used to further config this azure firewall. + */ + @JsonProperty(value = "additionalProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalProperties; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationRuleCollections() != null) { + applicationRuleCollections().forEach(e -> e.validate()); + } + if (natRuleCollections() != null) { + natRuleCollections().forEach(e -> e.validate()); + } + if (networkRuleCollections() != null) { + networkRuleCollections().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (managementIpConfiguration() != null) { + managementIpConfiguration().validate(); + } + if (hubIpAddresses() != null) { + hubIpAddresses().validate(); + } + if (ipGroups() != null) { + ipGroups().forEach(e -> e.validate()); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java new file mode 100644 index 0000000000000..583ec29507631 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure reachability report details. */ +@Fluent +public final class AzureReachabilityReportInner { + /* + * The aggregation level of Azure reachability report. Can be Country, State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aggregationLevel in model AzureReachabilityReportInner")); + } + if (providerLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportInner")); + } else { + providerLocation().validate(); + } + if (reachabilityReport() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reachabilityReport in model AzureReachabilityReportInner")); + } else { + reachabilityReport().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportInner.class); +} 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..4ecf98d1b4684 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.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.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Web Category Resource. */ +@Fluent +public final class AzureWebCategoryInner { + /* + * Properties of the Azure Web Category. + */ + @JsonProperty(value = "properties") + private AzureWebCategoryPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..b05c7601a8921 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryPropertiesFormat.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Web Category Properties. */ +@Immutable +public final class AzureWebCategoryPropertiesFormat { + /* + * The name of the group that the category belongs to. + */ + @JsonProperty(value = "group", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..0a6f5b77ae146 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.InboundNatRulePortMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response for a QueryInboundNatRulePortMapping API. */ +@Fluent +public final class BackendAddressInboundNatRulePortMappingsInner { + /* + * Collection of inbound NAT rule port mappings. + */ + @JsonProperty(value = "inboundNatRulePortMappings") + 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()); + } + } +} 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..b7c8d03e4d582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pool of backend IP addresses. */ +@Fluent +public final class BackendAddressPoolInner extends SubResource { + /* + * Properties of load balancer backend address pool. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..6d16442bb508b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolPropertiesFormat.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.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the backend address pool. */ +@Fluent +public final class BackendAddressPoolPropertiesFormat { + /* + * The location of the backend address pool. + */ + @JsonProperty(value = "location") + private String location; + + /* + * An array of gateway load balancer tunnel interfaces. + */ + @JsonProperty(value = "tunnelInterfaces") + private List tunnelInterfaces; + + /* + * An array of backend addresses. + */ + @JsonProperty(value = "loadBalancerBackendAddresses") + private List loadBalancerBackendAddresses; + + /* + * An array of references to IP addresses defined in network interfaces. + */ + @JsonProperty(value = "backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIpConfigurations; + + /* + * An array of references to load balancing rules that use this backend address pool. + */ + @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * A reference to an outbound rule that uses this backend address pool. + */ + @JsonProperty(value = "outboundRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundRule; + + /* + * An array of references to outbound rules that use this backend address pool. + */ + @JsonProperty(value = "outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /* + * An array of references to inbound NAT rules that use this backend address pool. + */ + @JsonProperty(value = "inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /* + * The provisioning state of the backend address pool resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Amount of seconds Load Balancer waits for before sending RESET to client and backend address. + */ + @JsonProperty(value = "drainPeriodInSeconds") + private Integer drainPeriodInSeconds; + + /* + * A reference to a virtual network. + */ + @JsonProperty(value = "virtualNetwork") + private SubResource virtualNetwork; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tunnelInterfaces() != null) { + tunnelInterfaces().forEach(e -> e.validate()); + } + if (loadBalancerBackendAddresses() != null) { + loadBalancerBackendAddresses().forEach(e -> e.validate()); + } + if (backendIpConfigurations() != null) { + backendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..dd07a53590681 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BaseAdminRuleInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.network.generated.models.AdminRule; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.DefaultAdminRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Network base admin rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = BaseAdminRuleInner.class) +@JsonTypeName("BaseAdminRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Custom", value = AdminRule.class), + @JsonSubTypes.Type(name = "Default", value = DefaultAdminRule.class) +}) +@Immutable +public class BaseAdminRuleInner extends ChildResource { + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of BaseAdminRuleInner class. */ + public BaseAdminRuleInner() { + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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..94688236cf5e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The session detail for a target. */ +@Immutable +public final class BastionActiveSessionInner { + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * The time when the session started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private Object startTime; + + /* + * The subscription id for the target virtual machine. + */ + @JsonProperty(value = "targetSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String targetSubscriptionId; + + /* + * The type of the resource. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The host name of the target. + */ + @JsonProperty(value = "targetHostName", access = JsonProperty.Access.WRITE_ONLY) + private String targetHostname; + + /* + * The resource group of the target. + */ + @JsonProperty(value = "targetResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGroup; + + /* + * The user name who is active on this session. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * The IP Address of the target. + */ + @JsonProperty(value = "targetIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String targetIpAddress; + + /* + * The protocol used to connect to the target. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private BastionConnectProtocol protocol; + + /* + * The resource id of the target. + */ + @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceId; + + /* + * Duration in mins the session has been active. + */ + @JsonProperty(value = "sessionDurationInMins", access = JsonProperty.Access.WRITE_ONLY) + private Float sessionDurationInMins; + + /** 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() { + } +} 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..65db25697c907 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Bastion Host resource. */ +@Fluent +public final class BastionHostInner extends Resource { + /* + * Represents the bastion host resource. + */ + @JsonProperty(value = "properties") + private BastionHostPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The sku of this Bastion Host. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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 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; + } + + /** {@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 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; + } + + /** + * 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(); + } + } +} 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..f073aa71e1535 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostIpConfigurationPropertiesFormat.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an Bastion Host. */ +@Fluent +public final class BastionHostIpConfigurationPropertiesFormat { + /* + * Reference of the subnet resource. + */ + @JsonProperty(value = "subnet", required = true) + private SubResource subnet; + + /* + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "publicIPAddress", required = true) + private SubResource publicIpAddress; + + /* + * The provisioning state of the bastion host IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Private IP allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnet in model BastionHostIpConfigurationPropertiesFormat")); + } + if (publicIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicIpAddress in model" + + " BastionHostIpConfigurationPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BastionHostIpConfigurationPropertiesFormat.class); +} 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..0f2d25b3b58d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostPropertiesFormat.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.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Bastion Host. */ +@Fluent +public final class BastionHostPropertiesFormat { + /* + * IP configuration of the Bastion Host resource. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * FQDN for the endpoint on which bastion host is accessible. + */ + @JsonProperty(value = "dnsName") + private String dnsName; + + /* + * The provisioning state of the bastion host resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The scale units for the Bastion Host resource. + */ + @JsonProperty(value = "scaleUnits") + private Integer scaleUnits; + + /* + * Enable/Disable Copy/Paste feature of the Bastion Host resource. + */ + @JsonProperty(value = "disableCopyPaste") + private Boolean disableCopyPaste; + + /* + * Enable/Disable File Copy feature of the Bastion Host resource. + */ + @JsonProperty(value = "enableFileCopy") + private Boolean enableFileCopy; + + /* + * Enable/Disable IP Connect feature of the Bastion Host resource. + */ + @JsonProperty(value = "enableIpConnect") + private Boolean enableIpConnect; + + /* + * Enable/Disable Shareable Link of the Bastion Host resource. + */ + @JsonProperty(value = "enableShareableLink") + private Boolean enableShareableLink; + + /* + * Enable/Disable Tunneling feature of the Bastion Host resource. + */ + @JsonProperty(value = "enableTunneling") + private Boolean enableTunneling; + + /** 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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..e2db5c771dd9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The session state detail for a target. */ +@Immutable +public final class BastionSessionStateInner { + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * Used for extra information. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The state of the session. Disconnected/Failed/NotFound. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** 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() { + } +} 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..91ddf15b45002 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VM; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Bastion Shareable Link. */ +@Fluent +public final class BastionShareableLinkInner { + /* + * Reference of the virtual machine resource. + */ + @JsonProperty(value = "vm", required = true) + private VM vm; + + /* + * The unique Bastion Shareable Link to the virtual machine. + */ + @JsonProperty(value = "bsl", access = JsonProperty.Access.WRITE_ONLY) + private String bsl; + + /* + * The time when the link was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Optional field indicating the warning or error message related to the vm in case of partial failure. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property vm in model BastionShareableLinkInner")); + } else { + vm().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BastionShareableLinkInner.class); +} 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..bfdc38c105d08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.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.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@Fluent +public final class BgpConnectionInner extends SubResource { + /* + * The properties of the Bgp connections. + */ + @JsonProperty(value = "properties") + private BgpConnectionProperties innerProperties; + + /* + * Name of the connection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Connection type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..387c552716921 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionProperties.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the bgp connection. */ +@Fluent +public final class BgpConnectionProperties { + /* + * Peer ASN. + */ + @JsonProperty(value = "peerAsn") + private Long peerAsn; + + /* + * Peer IP. + */ + @JsonProperty(value = "peerIp") + private String peerIp; + + /* + * The reference to the HubVirtualNetworkConnection resource. + */ + @JsonProperty(value = "hubVirtualNetworkConnection") + private SubResource hubVirtualNetworkConnection; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The current state of the VirtualHub to Peer. + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..3dc9f9c2038f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list BGP peer status API service call. */ +@Fluent +public final class BgpPeerStatusListResultInner { + /* + * List of BGP peers. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..5342639dbfd89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.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.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service Community Properties. */ +@Fluent +public final class BgpServiceCommunityInner extends Resource { + /* + * Properties of the BGP service community. + */ + @JsonProperty(value = "properties") + private BgpServiceCommunityPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..2b1f335e716bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityPropertiesFormat.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Service Community. */ +@Fluent +public final class BgpServiceCommunityPropertiesFormat { + /* + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * A list of bgp communities. + */ + @JsonProperty(value = "bgpCommunities") + 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()); + } + } +} 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..1af69d8301896 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the operation to create a connection monitor. */ +@Fluent +public class ConnectionMonitorParameters { + /* + * Describes the source of connection monitor. + */ + @JsonProperty(value = "source") + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "destination") + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + @JsonProperty(value = "testConfigurations") + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + @JsonProperty(value = "testGroups") + private List testGroups; + + /* + * List of connection monitor outputs. + */ + @JsonProperty(value = "outputs") + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + @JsonProperty(value = "notes") + private String notes; + + /** 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()); + } + } +} 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..802ff807feb2d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection states snapshots. */ +@Fluent +public final class ConnectionMonitorQueryResultInner { + /* + * Status of connection monitor source. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /* + * Information about connection states. + */ + @JsonProperty(value = "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()); + } + } +} 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..82ba37ecd80de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the connection monitor result. + */ + @JsonProperty(value = "properties") + private ConnectionMonitorResultProperties innerProperties; + + /** 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; + } + + /** {@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(); + } + } +} 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..a83d2424e48b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultProperties.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.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "monitoringStatus", access = JsonProperty.Access.WRITE_ONLY) + private String monitoringStatus; + + /* + * Type of connection monitor. + */ + @JsonProperty(value = "connectionMonitorType", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionMonitorType connectionMonitorType; + + /** 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() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..f6dd63174e1d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network connection reset shared key. */ +@Fluent +public final class ConnectionResetSharedKeyInner { + /* + * The virtual network connection reset shared key length, should between 1 and 128. + */ + @JsonProperty(value = "keyLength", required = true) + 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() { + } +} 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..7f4ef26fe3f5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GetConnectionSharedKey API service call. */ +@Fluent +public final class ConnectionSharedKeyInner extends SubResource { + /* + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ConnectionSharedKeyInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionSharedKeyInner.class); +} 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..7aefb9de1aaaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationInner.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.SystemData; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network manager connectivity configuration resource. */ +@Fluent +public final class ConnectivityConfigurationInner extends ChildResource { + /* + * Properties of a network manager connectivity configuration + */ + @JsonProperty(value = "properties") + private ConnectivityConfigurationProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..4b4d0532b621d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationProperties.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.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of network manager connectivity configuration. */ +@Fluent +public final class ConnectivityConfigurationProperties { + /* + * A description of the connectivity configuration. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Connectivity topology type. + */ + @JsonProperty(value = "connectivityTopology", required = true) + private ConnectivityTopology connectivityTopology; + + /* + * List of hubItems + */ + @JsonProperty(value = "hubs") + private List hubs; + + /* + * Flag if global mesh is supported. + */ + @JsonProperty(value = "isGlobal") + private IsGlobal isGlobal; + + /* + * Groups for configuration + */ + @JsonProperty(value = "appliesToGroups", required = true) + private List appliesToGroups; + + /* + * The provisioning state of the connectivity configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Flag if need to remove current existing peerings. + */ + @JsonProperty(value = "deleteExistingPeering") + private DeleteExistingPeering deleteExistingPeering; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectivityTopology() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectivityTopology in model ConnectivityConfigurationProperties")); + } + if (hubs() != null) { + hubs().forEach(e -> e.validate()); + } + if (appliesToGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appliesToGroups in model ConnectivityConfigurationProperties")); + } else { + appliesToGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityConfigurationProperties.class); +} 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..6d17de19a21ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information on the connectivity status. */ +@Immutable +public final class ConnectivityInformationInner { + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /* + * The connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /* + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /* + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /* + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /* + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /* + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** 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()); + } + } +} 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..082ee8f860ae8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface configuration properties. */ +@Fluent +public final class ContainerNetworkInterfaceConfigurationPropertiesFormat { + /* + * A list of ip configurations of the container network interface configuration. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * A list of container network interfaces created from this container network interface configuration. + */ + @JsonProperty(value = "containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /* + * The provisioning state of the container network interface configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..3b762bba66740 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the container network interface IP configuration. */ +@Immutable +public final class ContainerNetworkInterfaceIpConfigurationPropertiesFormat { + /* + * The provisioning state of the container network interface IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..f575798c93847 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of container network interface. */ +@Fluent +public final class ContainerNetworkInterfacePropertiesFormat { + /* + * Container network interface configuration from which this container network interface is created. + */ + @JsonProperty(value = "containerNetworkInterfaceConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; + + /* + * Reference to the container to which this container network interface is attached. + */ + @JsonProperty(value = "container") + private Container container; + + /* + * Reference to the ip configuration on this container nic. + */ + @JsonProperty(value = "ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * The provisioning state of the container network interface resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..0f41d1af1f08f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Custom IP prefix properties. + */ + @JsonProperty(value = "properties") + private CustomIpPrefixPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..dbe4c4f10fcb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixPropertiesFormat.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom IP prefix properties. */ +@Fluent +public final class CustomIpPrefixPropertiesFormat { + /* + * The ASN for CIDR advertising. Should be an integer as string. + */ + @JsonProperty(value = "asn") + private String asn; + + /* + * The prefix range in CIDR notation. Should include the start address and the prefix length. + */ + @JsonProperty(value = "cidr") + private String cidr; + + /* + * Signed message for WAN validation. + */ + @JsonProperty(value = "signedMessage") + private String signedMessage; + + /* + * Authorization message for WAN validation. + */ + @JsonProperty(value = "authorizationMessage") + private String authorizationMessage; + + /* + * The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + */ + @JsonProperty(value = "customIpPrefixParent") + private SubResource customIpPrefixParent; + + /* + * The list of all Children for IPv6 /48 CustomIpPrefix. + */ + @JsonProperty(value = "childCustomIpPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List childCustomIpPrefixes; + + /* + * The commissioned state of the Custom IP Prefix. + */ + @JsonProperty(value = "commissionedState") + private CommissionedState commissionedState; + + /* + * Whether to do express route advertise. + */ + @JsonProperty(value = "expressRouteAdvertise") + private Boolean expressRouteAdvertise; + + /* + * The Geo for CIDR advertising. Should be an Geo code. + */ + @JsonProperty(value = "geo") + private Geo geo; + + /* + * Whether to Advertise the range to Internet. + */ + @JsonProperty(value = "noInternetAdvertise") + private Boolean noInternetAdvertise; + + /* + * Type of custom IP prefix. Should be Singular, Parent, or Child. + */ + @JsonProperty(value = "prefixType") + private CustomIpPrefixType prefixType; + + /* + * The list of all referenced PublicIpPrefixes. + */ + @JsonProperty(value = "publicIpPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpPrefixes; + + /* + * The resource GUID property of the custom IP prefix resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The reason why resource is in failed state. + */ + @JsonProperty(value = "failedReason", access = JsonProperty.Access.WRITE_ONLY) + private String failedReason; + + /* + * The provisioning state of the custom IP prefix resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..020a9e06852b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private DdosCustomPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..02fae85a64b73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DDoS custom policy properties. */ +@Immutable +public final class DdosCustomPolicyPropertiesFormat { + /* + * The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if the + * user changes its name or migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DDoS custom policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..30d6c5d518cd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private DdosProtectionPlanPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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; + } + + /** {@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(); + } + } +} 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..66e2a8d3ed57b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DDoS protection plan properties. */ +@Immutable +public final class DdosProtectionPlanPropertiesFormat { + /* + * The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if + * the user changes its name or migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DDoS protection plan resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of public IPs associated with the DDoS protection plan resource. This list is read-only. + */ + @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + */ + @JsonProperty(value = "virtualNetworks", access = JsonProperty.Access.WRITE_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() { + } +} 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..84df677a19bf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultAdminPropertiesFormat.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security default admin rule resource. */ +@Fluent +public final class DefaultAdminPropertiesFormat { + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Default rule flag. + */ + @JsonProperty(value = "flag") + private String flag; + + /* + * Network protocol this rule applies to. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private SecurityConfigurationRuleProtocol protocol; + + /* + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "sources", access = JsonProperty.Access.WRITE_ONLY) + private List sources; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "destinations", access = JsonProperty.Access.WRITE_ONLY) + private List destinations; + + /* + * The source port ranges. + */ + @JsonProperty(value = "sourcePortRanges", access = JsonProperty.Access.WRITE_ONLY) + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + @JsonProperty(value = "destinationPortRanges", access = JsonProperty.Access.WRITE_ONLY) + private List destinationPortRanges; + + /* + * Indicates the access allowed for this particular rule + */ + @JsonProperty(value = "access", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "priority", access = JsonProperty.Access.WRITE_ONLY) + private Integer priority; + + /* + * Indicates if the traffic matched against the rule in inbound or outbound. + */ + @JsonProperty(value = "direction", access = JsonProperty.Access.WRITE_ONLY) + private SecurityConfigurationRuleDirection direction; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * 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()); + } + } +} 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..708546b5c51cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultRuleSetPropertyFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** the default web application firewall rule set. */ +@Fluent +public final class DefaultRuleSetPropertyFormat { + /* + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "ruleSetType") + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "ruleSetVersion") + 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() { + } +} 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..87f2b53aa3c06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the CheckDnsNameAvailability API service call. */ +@Fluent +public final class DnsNameAvailabilityResultInner { + /* + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + 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() { + } +} 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..4493dc82096f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.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.management.Resource; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private DscpConfigurationPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..d0bd59d6ec197 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationPropertiesFormat.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Differentiated Services Code Point configuration properties. */ +@Fluent +public final class DscpConfigurationPropertiesFormat { + /* + * List of markings to be used in the configuration. + */ + @JsonProperty(value = "markings") + private List markings; + + /* + * Source IP ranges. + */ + @JsonProperty(value = "sourceIpRanges") + private List sourceIpRanges; + + /* + * Destination IP ranges. + */ + @JsonProperty(value = "destinationIpRanges") + private List destinationIpRanges; + + /* + * Sources port ranges. + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * Destination port ranges. + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * RNM supported protocol types. + */ + @JsonProperty(value = "protocol") + private ProtocolType protocol; + + /* + * QoS object definitions + */ + @JsonProperty(value = "qosDefinitionCollection") + private List qosDefinitionCollection; + + /* + * Qos Collection ID generated by RNM. + */ + @JsonProperty(value = "qosCollectionId", access = JsonProperty.Access.WRITE_ONLY) + private String qosCollectionId; + + /* + * Associated Network Interfaces to the DSCP Configuration. + */ + @JsonProperty(value = "associatedNetworkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List associatedNetworkInterfaces; + + /* + * The resource GUID property of the DSCP Configuration resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the DSCP Configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..f36c77559eb8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective network security groups API service call. */ +@Fluent +public final class EffectiveNetworkSecurityGroupListResultInner { + /* + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..6c6d62218dc2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective route API service call. */ +@Fluent +public final class EffectiveRouteListResultInner { + /* + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..81d976e3c69d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Endpoint service. */ +@Fluent +public final class EndpointServiceResultInner extends SubResource { + /* + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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() { + } +} 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..85c284f507a5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authorization in an ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitAuthorizationInner extends SubResource { + /* + * Properties of the express route circuit authorization. + */ + @JsonProperty(value = "properties") + private AuthorizationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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 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(); + } + } +} 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..c2aaf29edc88d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.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.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@Fluent +public final class ExpressRouteCircuitConnectionInner extends SubResource { + /* + * Properties of the express route circuit connection. + */ + @JsonProperty(value = "properties") + private ExpressRouteCircuitConnectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..996aa9ea3372c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.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.SubResource; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the express route circuit connection. */ +@Fluent +public final class ExpressRouteCircuitConnectionPropertiesFormat { + /* + * Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + */ + @JsonProperty(value = "expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the peered circuit. + */ + @JsonProperty(value = "peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * The authorization key. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * IPv6 Address PrefixProperties of the express route circuit connection. + */ + @JsonProperty(value = "ipv6CircuitConnectionConfig") + private Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The provisioning state of the express route circuit connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..9788740f4742c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.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.Resource; +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.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitInner extends Resource { + /* + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /* + * Properties of the express route circuit. + */ + @JsonProperty(value = "properties") + private ExpressRouteCircuitPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + + /** + * 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(); + } + } +} 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..3c73c62a308be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Peering in an ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitPeeringInner extends SubResource { + /* + * Properties of the express route circuit peering. + */ + @JsonProperty(value = "properties") + private ExpressRouteCircuitPeeringPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..0a074921e3b52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the express route circuit peering. */ +@Fluent +public final class ExpressRouteCircuitPeeringPropertiesFormatInner { + /* + * The peering type. + */ + @JsonProperty(value = "peeringType") + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + @JsonProperty(value = "state") + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + @JsonProperty(value = "azureASN") + private Integer azureAsn; + + /* + * The peer ASN. + */ + @JsonProperty(value = "peerASN") + private Long peerAsn; + + /* + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + @JsonProperty(value = "primaryAzurePort") + private String primaryAzurePort; + + /* + * The secondary port. + */ + @JsonProperty(value = "secondaryAzurePort") + private String secondaryAzurePort; + + /* + * The shared key. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * The VLAN ID. + */ + @JsonProperty(value = "vlanId") + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The peering stats of express route circuit. + */ + @JsonProperty(value = "stats") + private ExpressRouteCircuitStatsInner stats; + + /* + * The provisioning state of the express route circuit peering resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * The reference to the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private SubResource routeFilter; + + /* + * The IPv6 peering configuration. + */ + @JsonProperty(value = "ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /* + * The ExpressRoute connection. + */ + @JsonProperty(value = "expressRouteConnection") + private ExpressRouteConnectionId expressRouteConnection; + + /* + * The list of circuit connections associated with Azure Private Peering for this circuit. + */ + @JsonProperty(value = "connections") + private List connections; + + /* + * The list of peered circuit connections associated with Azure Private Peering for this circuit. + */ + @JsonProperty(value = "peeredConnections", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..81cd06b80f12e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.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.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitPropertiesFormat { + /* + * Allow classic operations. + */ + @JsonProperty(value = "allowClassicOperations") + private Boolean allowClassicOperations; + + /* + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "circuitProvisioningState") + private String circuitProvisioningState; + + /* + * The ServiceProviderProvisioningState state of the resource. + */ + @JsonProperty(value = "serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * The list of authorizations. + */ + @JsonProperty(value = "authorizations") + private List authorizations; + + /* + * The list of peerings. + */ + @JsonProperty(value = "peerings") + private List peerings; + + /* + * The ServiceKey. + */ + @JsonProperty(value = "serviceKey") + private String serviceKey; + + /* + * The ServiceProviderNotes. + */ + @JsonProperty(value = "serviceProviderNotes") + private String serviceProviderNotes; + + /* + * The ServiceProviderProperties. + */ + @JsonProperty(value = "serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /* + * The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + */ + @JsonProperty(value = "expressRoutePort") + private SubResource expressRoutePort; + + /* + * The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + */ + @JsonProperty(value = "bandwidthInGbps") + private Float bandwidthInGbps; + + /* + * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + */ + @JsonProperty(value = "stag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /* + * The provisioning state of the express route circuit resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Flag denoting global reach status. + */ + @JsonProperty(value = "globalReachEnabled") + private Boolean globalReachEnabled; + + /* + * The authorizationKey. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * The authorization status of the Circuit. + */ + @JsonProperty(value = "authorizationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String authorizationStatus; + + /** 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; + } + + /** + * 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(); + } + } +} 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..64ede53298a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains stats associated with the peering. */ +@Fluent +public final class ExpressRouteCircuitStatsInner { + /* + * The Primary BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /* + * The primary BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /* + * The secondary BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /* + * The secondary BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** 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() { + } +} 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..953ad2e0ef3cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListArpTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsArpTableListResultInner { + /* + * A list of the ARP tables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..2c1c293c32b82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableListResultInner { + /* + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..30eba96f2a6c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..356cae2fc1c0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteConnection resource. */ +@Fluent +public final class ExpressRouteConnectionInner extends SubResource { + /* + * Properties of the express route connection. + */ + @JsonProperty(value = "properties") + private ExpressRouteConnectionProperties innerProperties; + + /* + * The name of the resource. + */ + @JsonProperty(value = "name", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ExpressRouteConnectionInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteConnectionInner.class); +} 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..93f7b657e3de9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRouteConnection list. */ +@Fluent +public final class ExpressRouteConnectionListInner { + /* + * The list of ExpressRoute connections. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..c37d8dd32e180 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionProperties.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the ExpressRouteConnection subresource. */ +@Fluent +public final class ExpressRouteConnectionProperties { + /* + * The provisioning state of the express route connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The ExpressRoute circuit peering. + */ + @JsonProperty(value = "expressRouteCircuitPeering", required = true) + private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; + + /* + * Authorization key to establish the connection. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * The routing weight associated to the connection. + */ + @JsonProperty(value = "routingWeight") + private Integer routingWeight; + + /* + * Enable internet security. + */ + @JsonProperty(value = "enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * Enable FastPath to vWan Firewall hub. + */ + @JsonProperty(value = "expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + @JsonProperty(value = "enablePrivateLinkFastPath") + private Boolean enablePrivateLinkFastPath; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + @JsonProperty(value = "routingConfiguration") + 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 + .logExceptionAsError( + 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); +} 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..1e4cf23769302 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.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.Resource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCrossConnection resource. */ +@Fluent +public final class ExpressRouteCrossConnectionInner extends Resource { + /* + * Properties of the express route cross connection. + */ + @JsonProperty(value = "properties") + private ExpressRouteCrossConnectionProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..d351f3db7c126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peering in an ExpressRoute Cross Connection resource. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /* + * Properties of the express route cross connection peering. + */ + @JsonProperty(value = "properties") + private ExpressRouteCrossConnectionPeeringProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..4dddc15a058a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringProperties.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of express route cross connection peering. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringProperties { + /* + * The peering type. + */ + @JsonProperty(value = "peeringType") + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + @JsonProperty(value = "state") + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + @JsonProperty(value = "azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureAsn; + + /* + * The peer ASN. + */ + @JsonProperty(value = "peerASN") + private Long peerAsn; + + /* + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + @JsonProperty(value = "primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /* + * The secondary port. + */ + @JsonProperty(value = "secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /* + * The shared key. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * The VLAN ID. + */ + @JsonProperty(value = "vlanId") + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The provisioning state of the express route cross connection peering resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + @JsonProperty(value = "gatewayManagerEtag") + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * The IPv6 peering configuration. + */ + @JsonProperty(value = "ipv6PeeringConfig") + 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(); + } + } +} 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..bb84436537d60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.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.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteCrossConnection. */ +@Fluent +public final class ExpressRouteCrossConnectionProperties { + /* + * The name of the primary port. + */ + @JsonProperty(value = "primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /* + * The name of the secondary port. + */ + @JsonProperty(value = "secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /* + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /* + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "peeringLocation", access = JsonProperty.Access.WRITE_ONLY) + private String peeringLocation; + + /* + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "bandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer bandwidthInMbps; + + /* + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /* + * The provisioning state of the circuit in the connectivity provider system. + */ + @JsonProperty(value = "serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "serviceProviderNotes") + private String serviceProviderNotes; + + /* + * The provisioning state of the express route cross connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of peerings. + */ + @JsonProperty(value = "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()); + } + } +} 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..bec4717c871ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Cross Connections. */ +@Fluent +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..f68f8e7329927 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.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.management.Resource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoute gateway resource. */ +@Fluent +public final class ExpressRouteGatewayInner extends Resource { + /* + * Properties of the express route gateway. + */ + @JsonProperty(value = "properties") + private ExpressRouteGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..11c1616feb6ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ExpressRoute gateways. */ +@Fluent +public final class ExpressRouteGatewayListInner { + /* + * List of ExpressRoute gateways. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..17b87120a1a7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayProperties.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoute gateway resource properties. */ +@Fluent +public final class ExpressRouteGatewayProperties { + /* + * Configuration for auto scaling. + */ + @JsonProperty(value = "autoScaleConfiguration") + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /* + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + @JsonProperty(value = "expressRouteConnections") + private List expressRouteConnections; + + /* + * The provisioning state of the express route gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The Virtual Hub where the ExpressRoute gateway is or will be deployed. + */ + @JsonProperty(value = "virtualHub", required = true) + private VirtualHubId virtualHub; + + /* + * Configures this gateway to accept traffic from non Virtual WAN networks. + */ + @JsonProperty(value = "allowNonVirtualWanTraffic") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualHub in model ExpressRouteGatewayProperties")); + } else { + virtualHub().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteGatewayProperties.class); +} 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..acb83dace5e76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRouteLink + * + *

ExpressRouteLink child resource definition. + */ +@Fluent +public final class ExpressRouteLinkInner extends SubResource { + /* + * ExpressRouteLink Resource Properties + * + * ExpressRouteLink properties. + */ + @JsonProperty(value = "properties") + private ExpressRouteLinkPropertiesFormat innerProperties; + + /* + * Name of child port resource that is unique among child port resources of the parent. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** Creates an instance of ExpressRouteLinkInner class. */ + public ExpressRouteLinkInner() { + } + + /** + * Get the innerProperties property: ExpressRouteLink Resource Properties + * + *

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: Definition of ExpressRouteLink Mac Security configuration. + * + *

MacSec configuration. + * + * @return the macSecConfig value. + */ + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.innerProperties() == null ? null : this.innerProperties().macSecConfig(); + } + + /** + * Set the macSecConfig property: Definition of ExpressRouteLink Mac Security configuration. + * + *

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(); + } + } +} 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..8ba555be34db3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkPropertiesFormat.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRouteLink Resource Properties + * + *

Properties specific to ExpressRouteLink resources. + */ +@Fluent +public final class ExpressRouteLinkPropertiesFormat { + /* + * Name of Azure router associated with physical port. + */ + @JsonProperty(value = "routerName", access = JsonProperty.Access.WRITE_ONLY) + private String routerName; + + /* + * Name of Azure router interface. + */ + @JsonProperty(value = "interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /* + * Mapping between physical port to patch panel port. + */ + @JsonProperty(value = "patchPanelId", access = JsonProperty.Access.WRITE_ONLY) + private String patchPanelId; + + /* + * Mapping of physical patch panel to rack. + */ + @JsonProperty(value = "rackId", access = JsonProperty.Access.WRITE_ONLY) + private String rackId; + + /* + * Cololocation for ExpressRoute Hybrid Direct. + */ + @JsonProperty(value = "coloLocation", access = JsonProperty.Access.WRITE_ONLY) + private String coloLocation; + + /* + * Physical fiber port type. + */ + @JsonProperty(value = "connectorType", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteLinkConnectorType connectorType; + + /* + * Administrative state of the physical port. + */ + @JsonProperty(value = "adminState") + private ExpressRouteLinkAdminState adminState; + + /* + * The provisioning state of the express route link resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Definition of ExpressRouteLink Mac Security configuration. + * + * MacSec configuration. + */ + @JsonProperty(value = "macSecConfig") + 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: Definition of ExpressRouteLink Mac Security configuration. + * + *

MacSec configuration. + * + * @return the macSecConfig value. + */ + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.macSecConfig; + } + + /** + * Set the macSecConfig property: Definition of ExpressRouteLink Mac Security configuration. + * + *

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(); + } + } +} 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..7c949ed62ed5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoute Port Authorization + * + *

ExpressRoutePort Authorization resource definition. + */ +@Fluent +public final class ExpressRoutePortAuthorizationInner extends SubResource { + /* + * ExpressRoute Port Authorization Properties + * + * ExpressRoutePort properties. + */ + @JsonProperty(value = "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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of ExpressRoutePortAuthorizationInner class. */ + public ExpressRoutePortAuthorizationInner() { + } + + /** + * Get the innerProperties property: ExpressRoute Port Authorization Properties + * + *

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(); + } + } +} 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..0fa08149f8218 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.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.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoute Port Authorization Properties + * + *

Properties of ExpressRoutePort Authorization. + */ +@Immutable +public final class ExpressRoutePortAuthorizationPropertiesFormat { + /* + * The authorization key. + */ + @JsonProperty(value = "authorizationKey", access = JsonProperty.Access.WRITE_ONLY) + private String authorizationKey; + + /* + * The authorization use status. + */ + @JsonProperty(value = "authorizationUseStatus", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRoutePortAuthorizationUseStatus authorizationUseStatus; + + /* + * The reference to the ExpressRoute circuit resource using the authorization. + */ + @JsonProperty(value = "circuitResourceUri", access = JsonProperty.Access.WRITE_ONLY) + private String circuitResourceUri; + + /* + * The provisioning state of the authorization resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..46e07043a28a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * ExpressRoute Port + * + *

ExpressRoutePort resource definition. + */ +@Fluent +public final class ExpressRoutePortInner extends Resource { + /* + * ExpressRoutePort Properties + * + * ExpressRoutePort properties. + */ + @JsonProperty(value = "properties") + private ExpressRoutePortPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The identity of ExpressRoutePort, if configured. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ExpressRoutePortInner class. */ + public ExpressRoutePortInner() { + } + + /** + * Get the innerProperties property: ExpressRoutePort Properties + * + *

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; + } + + /** {@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: ExpressRouteLink Sub-Resources + * + *

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: ExpressRouteLink Sub-Resources + * + *

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(); + } + } +} 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..275f5f531826e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortPropertiesFormat.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRoutePort Properties + * + *

Properties specific to ExpressRoutePort resources. + */ +@Fluent +public final class ExpressRoutePortPropertiesFormat { + /* + * The name of the peering location that the ExpressRoutePort is mapped to physically. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * Bandwidth of procured ports in Gbps. + */ + @JsonProperty(value = "bandwidthInGbps") + private Integer bandwidthInGbps; + + /* + * Aggregate Gbps of associated circuit bandwidths. + */ + @JsonProperty(value = "provisionedBandwidthInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Float provisionedBandwidthInGbps; + + /* + * Maximum transmission unit of the physical port pair(s). + */ + @JsonProperty(value = "mtu", access = JsonProperty.Access.WRITE_ONLY) + private String mtu; + + /* + * Encapsulation method on physical ports. + */ + @JsonProperty(value = "encapsulation") + private ExpressRoutePortsEncapsulation encapsulation; + + /* + * Ether type of the physical port. + */ + @JsonProperty(value = "etherType", access = JsonProperty.Access.WRITE_ONLY) + private String etherType; + + /* + * Date of the physical port allocation to be used in Letter of Authorization. + */ + @JsonProperty(value = "allocationDate", access = JsonProperty.Access.WRITE_ONLY) + private String allocationDate; + + /* + * ExpressRouteLink Sub-Resources + * + * The set of physical links of the ExpressRoutePort resource. + */ + @JsonProperty(value = "links") + private List links; + + /* + * Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. + */ + @JsonProperty(value = "circuits", access = JsonProperty.Access.WRITE_ONLY) + private List circuits; + + /* + * The provisioning state of the express route port resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the express route port resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The billing type of the ExpressRoutePort resource. + */ + @JsonProperty(value = "billingType") + 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: ExpressRouteLink Sub-Resources + * + *

The set of physical links of the ExpressRoutePort resource. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: ExpressRouteLink Sub-Resources + * + *

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()); + } + } +} 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..26219dbabc594 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * ExpressRoutePorts Location Properties + * + * ExpressRoutePort peering location properties. + */ + @JsonProperty(value = "properties") + private ExpressRoutePortsLocationPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ExpressRoutePortsLocationInner class. */ + public ExpressRoutePortsLocationInner() { + } + + /** + * Get the innerProperties property: ExpressRoutePorts Location Properties + * + *

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; + } + + /** {@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(); + } + } +} 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..c64de95cc31bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRoutePorts Location Properties + * + *

Properties specific to ExpressRoutePorts peering location resources. + */ +@Fluent +public final class ExpressRoutePortsLocationPropertiesFormat { + /* + * Address of peering location. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * Contact details of peering locations. + */ + @JsonProperty(value = "contact", access = JsonProperty.Access.WRITE_ONLY) + private String contact; + + /* + * The inventory of available ExpressRoutePort bandwidths. + */ + @JsonProperty(value = "availableBandwidths") + private List availableBandwidths; + + /* + * The provisioning state of the express route port location resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..35126d8d6c941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortInner.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.Resource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** ExpressRouteProviderPort resource. */ +@Fluent +public final class ExpressRouteProviderPortInner extends Resource { + /* + * Properties of the express route Service Provider Port. + */ + @JsonProperty(value = "properties") + private ExpressRouteProviderPortProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..23d7fd7b22bcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortListResultInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteProviderPort API service call. */ +@Fluent +public final class ExpressRouteProviderPortListResultInner { + /* + * A list of ExpressRouteProviderPort resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..7fcbc47019d0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of ExpressRouteProviderPort. */ +@Fluent +public final class ExpressRouteProviderPortProperties { + /* + * The name of the port pair. + */ + @JsonProperty(value = "portPairDescriptor", access = JsonProperty.Access.WRITE_ONLY) + private String portPairDescriptor; + + /* + * The name of the primary port. + */ + @JsonProperty(value = "primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /* + * The name of the secondary port. + */ + @JsonProperty(value = "secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /* + * The peering location of the port pair. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * Overprovisioning factor for the port pair. + */ + @JsonProperty(value = "overprovisionFactor") + private Integer overprovisionFactor; + + /* + * Bandwidth of the port in Mbps + */ + @JsonProperty(value = "portBandwidthInMbps") + private Integer portBandwidthInMbps; + + /* + * Used Bandwidth of the port in Mbps + */ + @JsonProperty(value = "usedBandwidthInMbps") + private Integer usedBandwidthInMbps; + + /* + * Remaining Bandwidth of the port in Mbps + */ + @JsonProperty(value = "remainingBandwidthInMbps") + 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() { + } +} 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..8aadaa7d492f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ExpressRouteServiceProviderPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..4abf59dbaa4f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderPropertiesFormat.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.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteServiceProvider. */ +@Fluent +public final class ExpressRouteServiceProviderPropertiesFormat { + /* + * A list of peering locations. + */ + @JsonProperty(value = "peeringLocations") + private List peeringLocations; + + /* + * A list of bandwidths offered. + */ + @JsonProperty(value = "bandwidthsOffered") + private List bandwidthsOffered; + + /* + * The provisioning state of the express route service provider resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..fc18b8adff191 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** FirewallPolicy Resource. */ +@Fluent +public final class FirewallPolicyInner extends Resource { + /* + * Properties of the firewall policy. + */ + @JsonProperty(value = "properties") + private FirewallPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The identity of the firewall policy. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 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(); + } + } +} 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..488ecd28fd959 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyPropertiesFormat.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.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Firewall Policy definition. */ +@Fluent +public final class FirewallPolicyPropertiesFormat { + /* + * List of references to FirewallPolicyRuleCollectionGroups. + */ + @JsonProperty(value = "ruleCollectionGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ruleCollectionGroups; + + /* + * The provisioning state of the firewall policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The parent firewall policy from which rules are inherited. + */ + @JsonProperty(value = "basePolicy") + private SubResource basePolicy; + + /* + * List of references to Azure Firewalls that this Firewall Policy is associated with. + */ + @JsonProperty(value = "firewalls", access = JsonProperty.Access.WRITE_ONLY) + private List firewalls; + + /* + * List of references to Child Firewall Policies. + */ + @JsonProperty(value = "childPolicies", access = JsonProperty.Access.WRITE_ONLY) + private List childPolicies; + + /* + * The operation mode for Threat Intelligence. + */ + @JsonProperty(value = "threatIntelMode") + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * ThreatIntel Whitelist for Firewall Policy. + */ + @JsonProperty(value = "threatIntelWhitelist") + private FirewallPolicyThreatIntelWhitelist threatIntelWhitelist; + + /* + * Insights on Firewall Policy. + */ + @JsonProperty(value = "insights") + private FirewallPolicyInsights insights; + + /* + * The private IP addresses/IP ranges to which traffic will not be SNAT. + */ + @JsonProperty(value = "snat") + private FirewallPolicySnat snat; + + /* + * SQL Settings definition. + */ + @JsonProperty(value = "sql") + private FirewallPolicySql sql; + + /* + * DNS Proxy Settings definition. + */ + @JsonProperty(value = "dnsSettings") + private DnsSettings dnsSettings; + + /* + * Explicit Proxy Settings definition. + */ + @JsonProperty(value = "explicitProxy") + private ExplicitProxy explicitProxy; + + /* + * The configuration for Intrusion detection. + */ + @JsonProperty(value = "intrusionDetection") + private FirewallPolicyIntrusionDetection intrusionDetection; + + /* + * TLS Configuration definition. + */ + @JsonProperty(value = "transportSecurity") + private FirewallPolicyTransportSecurity transportSecurity; + + /* + * The Firewall Policy SKU. + */ + @JsonProperty(value = "sku") + private FirewallPolicySku sku; + + /** Creates an instance of FirewallPolicyPropertiesFormat class. */ + public FirewallPolicyPropertiesFormat() { + } + + /** + * 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(); + } + } +} 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..80b6b55f11774 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rule Collection Group resource. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupInner extends SubResource { + /* + * The properties of the firewall policy rule collection group. + */ + @JsonProperty(value = "properties") + private FirewallPolicyRuleCollectionGroupProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Rule Group type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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 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(); + } + } +} 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..e41e1e63a8309 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupProperties.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.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the rule collection group. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupProperties { + /* + * Priority of the Firewall Policy Rule Collection Group resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Group of Firewall Policy rule collections. + */ + @JsonProperty(value = "ruleCollections") + private List ruleCollections; + + /* + * The provisioning state of the firewall policy rule collection group resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of FirewallPolicyRuleCollectionGroupProperties class. */ + public FirewallPolicyRuleCollectionGroupProperties() { + } + + /** + * 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()); + } + } +} 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..fc84eaa89ca86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.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.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information on the configuration of flow log and traffic analytics (optional) . */ +@Fluent +public final class FlowLogInformationInner { + /* + * The ID of the resource to configure for flow log and traffic analytics (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Properties of the flow log. + */ + @JsonProperty(value = "properties", required = true) + private FlowLogProperties innerProperties = new FlowLogProperties(); + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /** 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 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 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogInformationInner")); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model FlowLogInformationInner")); + } else { + innerProperties().validate(); + } + if (flowAnalyticsConfiguration() != null) { + flowAnalyticsConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogInformationInner.class); +} 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..da969688a68e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.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.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A flow log resource. */ +@Fluent +public final class FlowLogInner extends Resource { + /* + * Properties of the flow log. + */ + @JsonProperty(value = "properties") + private FlowLogPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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 id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public FlowLogInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FlowLogInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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 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(); + } + } +} 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..3bee9c47852e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of flow log. */ +@Fluent +public final class FlowLogProperties { + /* + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "storageId", required = true) + private String storageId; + + /* + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + @JsonProperty(value = "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 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 + .logExceptionAsError( + 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); +} 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..90f53cfc6bdc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of flow log. */ +@Fluent +public final class FlowLogPropertiesFormat { + /* + * ID of network security group to which flow log will be applied. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Guid of network security group to which flow log will be applied. + */ + @JsonProperty(value = "targetResourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGuid; + + /* + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "storageId", required = true) + private String storageId; + + /* + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + @JsonProperty(value = "format") + private FlowLogFormatParameters format; + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /* + * The provisioning state of the flow log. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogPropertiesFormat")); + } + if (storageId() == null) { + throw LOGGER + .logExceptionAsError( + 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); +} 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..eb0f8cddd5afc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Frontend IP address of the load balancer. */ +@Fluent +public final class FrontendIpConfigurationInner extends SubResource { + /* + * Properties of the load balancer probe. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** 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(); + } + } +} 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..8b86bef88bc70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationPropertiesFormatInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Frontend IP Configuration of the load balancer. */ +@Fluent +public final class FrontendIpConfigurationPropertiesFormatInner { + /* + * An array of references to inbound rules that use this frontend IP. + */ + @JsonProperty(value = "inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /* + * An array of references to inbound pools that use this frontend IP. + */ + @JsonProperty(value = "inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /* + * An array of references to outbound rules that use this frontend IP. + */ + @JsonProperty(value = "outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /* + * An array of references to load balancing rules that use this frontend IP. + */ + @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The Private IP allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + */ + @JsonProperty(value = "privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * The reference to the Public IP resource. + */ + @JsonProperty(value = "publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The reference to the Public IP Prefix resource. + */ + @JsonProperty(value = "publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * The reference to gateway load balancer frontend IP. + */ + @JsonProperty(value = "gatewayLoadBalancer") + private SubResource gatewayLoadBalancer; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..43220e687c62a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway routes. */ +@Fluent +public final class GatewayRouteListResultInner { + /* + * List of gateway routes. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..1cc9e53015eaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GenerateExpressRoutePortsLOA API service call. */ +@Fluent +public final class GenerateExpressRoutePortsLoaResultInner { + /* + * The content as a base64 encoded string. + */ + @JsonProperty(value = "encodedContent") + 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() { + } +} 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..67433fe8d5fd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HopLinkProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hop link properties. */ +@Immutable +public final class HopLinkProperties { + /* + * Minimum roundtrip time in milliseconds. + */ + @JsonProperty(value = "roundTripTimeMin", access = JsonProperty.Access.WRITE_ONLY) + private Long roundTripTimeMin; + + /* + * Average roundtrip time in milliseconds. + */ + @JsonProperty(value = "roundTripTimeAvg", access = JsonProperty.Access.WRITE_ONLY) + private Long roundTripTimeAvg; + + /* + * Maximum roundtrip time in milliseconds. + */ + @JsonProperty(value = "roundTripTimeMax", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..d24305482d544 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpConfigurations. */ +@Fluent +public final class HubIpConfigurationInner extends SubResource { + /* + * The properties of the Virtual Hub IPConfigurations. + */ + @JsonProperty(value = "properties") + private HubIpConfigurationPropertiesFormatInner innerProperties; + + /* + * Name of the Ip Configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Ipconfiguration type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..018b3de17a2cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationPropertiesFormatInner.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.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration. */ +@Fluent +public final class HubIpConfigurationPropertiesFormatInner { + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..6aab65e599c28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable resource in a virtual hub. */ +@Fluent +public final class HubRouteTableInner extends SubResource { + /* + * Properties of the RouteTable resource. + */ + @JsonProperty(value = "properties") + private HubRouteTableProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..bf0b964ab30fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableProperties.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.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for RouteTable. */ +@Fluent +public final class HubRouteTableProperties { + /* + * List of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /* + * List of labels associated with this route table. + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * List of all connections associated with this route table. + */ + @JsonProperty(value = "associatedConnections", access = JsonProperty.Access.WRITE_ONLY) + private List associatedConnections; + + /* + * List of all connections that advertise to this route table. + */ + @JsonProperty(value = "propagatingConnections", access = JsonProperty.Access.WRITE_ONLY) + private List propagatingConnections; + + /* + * The provisioning state of the RouteTable resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..5321f1b06328f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HubVirtualNetworkConnection Resource. */ +@Fluent +public final class HubVirtualNetworkConnectionInner extends SubResource { + /* + * Properties of the hub virtual network connection. + */ + @JsonProperty(value = "properties") + private HubVirtualNetworkConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..01c733f7c45fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionProperties.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for HubVirtualNetworkConnection. */ +@Fluent +public final class HubVirtualNetworkConnectionProperties { + /* + * Reference to the remote virtual network. + */ + @JsonProperty(value = "remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /* + * Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /* + * Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /* + * Enable internet security. + */ + @JsonProperty(value = "enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + @JsonProperty(value = "routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /* + * The provisioning state of the hub virtual network connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..fa259fa7e9224 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Inbound NAT pool. */ +@Fluent +public final class InboundNatPoolPropertiesFormat { + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * The reference to the transport protocol used by the inbound NAT pool. + */ + @JsonProperty(value = "protocol", required = true) + private TransportProtocol protocol; + + /* + * The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated + * with a load balancer. Acceptable values range between 1 and 65534. + */ + @JsonProperty(value = "frontendPortRangeStart", required = true) + 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. + */ + @JsonProperty(value = "frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /* + * The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + */ + @JsonProperty(value = "backendPort", required = true) + 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. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This + * setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is + * only used when the protocol is set to TCP. + */ + @JsonProperty(value = "enableTcpReset") + private Boolean enableTcpReset; + + /* + * The provisioning state of the inbound NAT pool resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model InboundNatPoolPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InboundNatPoolPropertiesFormat.class); +} 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..583570fa48449 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT rule of the load balancer. */ +@Fluent +public final class InboundNatRuleInner extends SubResource { + /* + * Properties of load balancer inbound NAT rule. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..beb5c9dfa6990 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRulePropertiesFormatInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the inbound NAT rule. */ +@Fluent +public final class InboundNatRulePropertiesFormatInner { + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of + * each of the frontend IP configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIpConfigurationInner backendIpConfiguration; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "protocol") + private TransportProtocol protocol; + + /* + * The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. + * Acceptable values range from 1 to 65534. + */ + @JsonProperty(value = "frontendPort") + private Integer frontendPort; + + /* + * The port used for the internal endpoint. Acceptable values range from 1 to 65535. + */ + @JsonProperty(value = "backendPort") + private Integer backendPort; + + /* + * The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 + * minutes. This element is only used when the protocol is set to TCP. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This + * setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is + * only used when the protocol is set to TCP. + */ + @JsonProperty(value = "enableTcpReset") + 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. + */ + @JsonProperty(value = "frontendPortRangeStart") + 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. + */ + @JsonProperty(value = "frontendPortRangeEnd") + private Integer frontendPortRangeEnd; + + /* + * A reference to backendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * The provisioning state of the inbound NAT rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..a8ad0f27bbfda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.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.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NVA Inbound Security Rule resource. */ +@Fluent +public final class InboundSecurityRuleInner extends SubResource { + /* + * The properties of the Inbound Security Rules. + */ + @JsonProperty(value = "properties") + private InboundSecurityRuleProperties innerProperties; + + /* + * Name of security rule collection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * NVA inbound security rule type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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 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(); + } + } +} 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..64fefa57ee40c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Inbound Security Rules resource. */ +@Fluent +public final class InboundSecurityRuleProperties { + /* + * List of allowed rules. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of InboundSecurityRuleProperties class. */ + public InboundSecurityRuleProperties() { + } + + /** + * 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()); + } + } +} 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..eb5b9dc0f94e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for CheckIPAddressAvailability API service call. */ +@Fluent +public final class IpAddressAvailabilityResultInner { + /* + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /* + * Contains other available private IP addresses if the asked for address is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIpAddresses; + + /* + * Private IP address platform reserved. + */ + @JsonProperty(value = "isPlatformReserved") + private Boolean isPlatformReserved; + + /** 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() { + } +} 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..a3ea21979bc99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.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.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** IpAllocation resource. */ +@Fluent +public final class IpAllocationInner extends Resource { + /* + * Properties of the IpAllocation. + */ + @JsonProperty(value = "properties") + private IpAllocationPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..4ae831d991465 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationPropertiesFormat.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.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties of the IpAllocation. */ +@Fluent +public final class IpAllocationPropertiesFormat { + /* + * The Subnet that using the prefix of this IpAllocation resource. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private SubResource subnet; + + /* + * The VirtualNetwork that using the prefix of this IpAllocation resource. + */ + @JsonProperty(value = "virtualNetwork", access = JsonProperty.Access.WRITE_ONLY) + private SubResource virtualNetwork; + + /* + * The type for the IpAllocation. + */ + @JsonProperty(value = "type") + private IpAllocationType type; + + /* + * The address prefix for the IpAllocation. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /* + * The address prefix length for the IpAllocation. + */ + @JsonProperty(value = "prefixLength") + private Integer prefixLength; + + /* + * The address prefix Type for the IpAllocation. + */ + @JsonProperty(value = "prefixType") + private IpVersion prefixType; + + /* + * The IPAM allocation ID. + */ + @JsonProperty(value = "ipamAllocationId") + private String ipamAllocationId; + + /* + * IpAllocation tags. + */ + @JsonProperty(value = "allocationTags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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() { + } +} 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..b9ca621e4d91d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration. */ +@Fluent +public final class IpConfigurationInner extends SubResource { + /* + * Properties of the IP configuration. + */ + @JsonProperty(value = "properties") + private IpConfigurationPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..e9f938ab9d739 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.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.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration profile child resource. */ +@Fluent +public final class IpConfigurationProfileInner extends SubResource { + /* + * Properties of the IP configuration profile. + */ + @JsonProperty(value = "properties") + private IpConfigurationProfilePropertiesFormatInner innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..e41cfa28e88a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfilePropertiesFormatInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration profile properties. */ +@Fluent +public final class IpConfigurationProfilePropertiesFormatInner { + /* + * The reference to the subnet resource to create a container network interface ip configuration. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * The provisioning state of the IP configuration profile resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..cf81f6f309e63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationPropertiesFormatInner.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.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration. */ +@Fluent +public final class IpConfigurationPropertiesFormatInner { + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..b438b6e95d87f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.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.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpGroups resource information. */ +@Fluent +public final class IpGroupInner extends Resource { + /* + * Properties of the IpGroups. + */ + @JsonProperty(value = "properties") + private IpGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..66c8b40150ff8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupPropertiesFormat.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IpGroups property information. */ +@Fluent +public final class IpGroupPropertiesFormat { + /* + * The provisioning state of the IpGroups resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * IpAddresses/IpAddressPrefixes in the IpGroups resource. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /* + * List of references to Firewall resources that this IpGroups is associated with. + */ + @JsonProperty(value = "firewalls", access = JsonProperty.Access.WRITE_ONLY) + private List firewalls; + + /* + * List of references to Firewall Policies resources that this IpGroups is associated with. + */ + @JsonProperty(value = "firewallPolicies", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..b4ee8e7ed3adb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpPrefixesListInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SNAT IP Prefixes learnt by firewall to not SNAT. */ +@Fluent +public final class IpPrefixesListInner { + /* + * IP Prefix value. + */ + @JsonProperty(value = "ipPrefixes") + 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() { + } +} 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..17abeae202a06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.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.resourcemanager.network.generated.models.LoadBalancerBackendAddressAdminState; +import com.azure.resourcemanager.network.generated.models.NatRulePortMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer backend addresses. */ +@Fluent +public final class LoadBalancerBackendAddressPropertiesFormat { + /* + * Reference to an existing virtual network. + */ + @JsonProperty(value = "virtualNetwork") + private SubResource virtualNetwork; + + /* + * Reference to an existing subnet. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * IP Address belonging to the referenced virtual network. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * Reference to IP address defined in network interfaces. + */ + @JsonProperty(value = "networkInterfaceIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource networkInterfaceIpConfiguration; + + /* + * Reference to the frontend ip address configuration defined in regional loadbalancer. + */ + @JsonProperty(value = "loadBalancerFrontendIPConfiguration") + private SubResource loadBalancerFrontendIpConfiguration; + + /* + * Collection of inbound NAT rule port mappings. + */ + @JsonProperty(value = "inboundNatRulesPortMapping", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "adminState") + 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()); + } + } +} 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..554831a810c70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** LoadBalancer resource. */ +@Fluent +public final class LoadBalancerInner extends Resource { + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /* + * Properties of load balancer. + */ + @JsonProperty(value = "properties") + private LoadBalancerPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..fe88a25cc9fdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerPropertiesFormat.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.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer. */ +@Fluent +public final class LoadBalancerPropertiesFormat { + /* + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /* + * Object collection representing the load balancing rules Gets the provisioning. + */ + @JsonProperty(value = "loadBalancingRules") + private List loadBalancingRules; + + /* + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "probes") + private List probes; + + /* + * Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is + * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine + * scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They + * have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "inboundNatRules") + private List inboundNatRules; + + /* + * Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. + * Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external + * port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining + * inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated + * with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound + * NAT rules. + */ + @JsonProperty(value = "inboundNatPools") + private List inboundNatPools; + + /* + * The outbound rules. + */ + @JsonProperty(value = "outboundRules") + private List outboundRules; + + /* + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the load balancer resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..f6f604b5909d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of VIP swap request's frontend IP configuration object. */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfigurationProperties { + /* + * A reference to public IP address resource. + */ + @JsonProperty(value = "publicIPAddress") + 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() { + } +} 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..0c426fc574e07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..323a077c3064b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRulePropertiesFormat.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer. */ +@Fluent +public final class LoadBalancingRulePropertiesFormat { + /* + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "frontendIPConfiguration") + private SubResource frontendIpConfiguration; + + /* + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * An array of references to pool of DIPs. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /* + * The reference to the load balancer probe used by the load balancing rule. + */ + @JsonProperty(value = "probe") + private SubResource probe; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "protocol", required = true) + private TransportProtocol protocol; + + /* + * The load distribution policy for this rule. + */ + @JsonProperty(value = "loadDistribution") + private LoadDistribution loadDistribution; + + /* + * The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. + * Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "frontendPort", required = true) + 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". + */ + @JsonProperty(value = "backendPort") + private Integer backendPort; + + /* + * The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 + * minutes. This element is only used when the protocol is set to TCP. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn + * Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This + * setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "enableFloatingIP") + private Boolean enableFloatingIp; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is + * only used when the protocol is set to TCP. + */ + @JsonProperty(value = "enableTcpReset") + private Boolean enableTcpReset; + + /* + * Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the + * load balancing rule. + */ + @JsonProperty(value = "disableOutboundSnat") + private Boolean disableOutboundSnat; + + /* + * The provisioning state of the load balancing rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model LoadBalancingRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBalancingRulePropertiesFormat.class); +} 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..88858809f3cc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A common class for general resource information. */ +@Fluent +public final class LocalNetworkGatewayInner extends Resource { + /* + * Properties of the local network gateway. + */ + @JsonProperty(value = "properties", required = true) + private LocalNetworkGatewayPropertiesFormat innerProperties = new LocalNetworkGatewayPropertiesFormat(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LocalNetworkGatewayInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LocalNetworkGatewayInner.class); +} 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..48ad169b4a234 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayPropertiesFormat.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.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LocalNetworkGateway properties. */ +@Fluent +public final class LocalNetworkGatewayPropertiesFormat { + /* + * Local network site address space. + */ + @JsonProperty(value = "localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /* + * IP address of local network gateway. + */ + @JsonProperty(value = "gatewayIpAddress") + private String gatewayIpAddress; + + /* + * FQDN of local network gateway. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "bgpSettings") + private BgpSettings bgpSettings; + + /* + * The resource GUID property of the local network gateway resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the local network gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..834281f0000f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Nat Gateway resource. */ +@Fluent +public final class NatGatewayInner extends Resource { + /* + * The nat gateway SKU. + */ + @JsonProperty(value = "sku") + private NatGatewaySku sku; + + /* + * Nat Gateway properties. + */ + @JsonProperty(value = "properties") + private NatGatewayPropertiesFormat innerProperties; + + /* + * A list of availability zones denoting the zone in which Nat Gateway should be deployed. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..e41901365c536 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayPropertiesFormat.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Nat Gateway properties. */ +@Fluent +public final class NatGatewayPropertiesFormat { + /* + * The idle timeout of the nat gateway. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * An array of public ip addresses associated with the nat gateway resource. + */ + @JsonProperty(value = "publicIpAddresses") + private List publicIpAddresses; + + /* + * An array of public ip prefixes associated with the nat gateway resource. + */ + @JsonProperty(value = "publicIpPrefixes") + private List publicIpPrefixes; + + /* + * An array of references to the subnets using this nat gateway resource. + */ + @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * The resource GUID property of the NAT gateway resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the NAT gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..00562de8fa20b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Results of network configuration diagnostic on the target resource. */ +@Immutable +public final class NetworkConfigurationDiagnosticResponseInner { + /* + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..bede632bda1bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupInner.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network group resource. */ +@Fluent +public final class NetworkGroupInner extends ChildResource { + /* + * The Network Group properties + */ + @JsonProperty(value = "properties") + private NetworkGroupProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..1a1fd65d04dca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of network group. */ +@Fluent +public final class NetworkGroupProperties { + /* + * A description of the network group. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The provisioning state of the scope assignment resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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 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() { + } +} 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..3667a04915793 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Properties of the network interface. + */ + @JsonProperty(value = "properties") + private NetworkInterfacePropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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; + } + + /** + * 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(); + } + } +} 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..769ef159a6bd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IPConfiguration in a network interface. */ +@Fluent +public final class NetworkInterfaceIpConfigurationInner extends SubResource { + /* + * Network interface IP configuration properties. + */ + @JsonProperty(value = "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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** 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. + * + * @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. + * + * @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 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(); + } + } +} 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..949559f54f953 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of IP configuration. */ +@Fluent +public final class NetworkInterfaceIpConfigurationPropertiesFormatInner { + /* + * The reference to gateway load balancer frontend IP. + */ + @JsonProperty(value = "gatewayLoadBalancer") + private SubResource gatewayLoadBalancer; + + /* + * The reference to Virtual Network Taps. + */ + @JsonProperty(value = "virtualNetworkTaps") + private List virtualNetworkTaps; + + /* + * The reference to ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * The reference to LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /* + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + @JsonProperty(value = "privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * Whether this is a primary customer address on the network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "publicIPAddress") + private PublicIpAddressInner publicIpAddress; + + /* + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * The provisioning state of the network interface IP configuration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * PrivateLinkConnection properties for the network interface. + */ + @JsonProperty(value = "privateLinkConnectionProperties", access = JsonProperty.Access.WRITE_ONLY) + 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. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner 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 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(); + } + } +} 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..b9bfeb1c3388c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.java @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkInterface properties. */ +@Fluent +public final class NetworkInterfacePropertiesFormatInner { + /* + * The reference to a virtual machine. + */ + @JsonProperty(value = "virtualMachine", access = JsonProperty.Access.WRITE_ONLY) + private SubResource virtualMachine; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * A reference to the private endpoint to which the network interface is linked. + */ + @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * A list of TapConfigurations of the network interface. + */ + @JsonProperty(value = "tapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List tapConfigurations; + + /* + * The DNS settings in network interface. + */ + @JsonProperty(value = "dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /* + * The MAC address of the network interface. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * Whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "primary", access = JsonProperty.Access.WRITE_ONLY) + private Boolean primary; + + /* + * Whether the virtual machine this nic is attached to supports encryption. + */ + @JsonProperty(value = "vnetEncryptionSupported", access = JsonProperty.Access.WRITE_ONLY) + private Boolean vnetEncryptionSupported; + + /* + * If the network interface is configured for accelerated networking. Not applicable to VM sizes which require + * accelerated networking. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Indicates whether to disable tcp state tracking. + */ + @JsonProperty(value = "disableTcpStateTracking") + private Boolean disableTcpStateTracking; + + /* + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * A list of references to linked BareMetal resources. + */ + @JsonProperty(value = "hostedWorkloads", access = JsonProperty.Access.WRITE_ONLY) + private List hostedWorkloads; + + /* + * A reference to the dscp configuration to which the network interface is linked. + */ + @JsonProperty(value = "dscpConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource dscpConfiguration; + + /* + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network interface resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * WorkloadType of the NetworkInterface for BareMetal resources + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * Type of Network Interface resource. + */ + @JsonProperty(value = "nicType") + private NetworkInterfaceNicType nicType; + + /* + * Privatelinkservice of the network interface resource. + */ + @JsonProperty(value = "privateLinkService") + private PrivateLinkServiceInner privateLinkService; + + /* + * Migration phase of Network Interface resource. + */ + @JsonProperty(value = "migrationPhase") + private NetworkInterfaceMigrationPhase migrationPhase; + + /* + * Auxiliary mode of Network Interface resource. + */ + @JsonProperty(value = "auxiliaryMode") + private NetworkInterfaceAuxiliaryMode auxiliaryMode; + + /** 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; + } + + /** + * 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(); + } + } +} 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..1a7f6123924aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.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.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tap configuration in a Network Interface. */ +@Fluent +public final class NetworkInterfaceTapConfigurationInner extends SubResource { + /* + * Properties of the Virtual Network Tap configuration. + */ + @JsonProperty(value = "properties") + private NetworkInterfaceTapConfigurationPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..8b46530e55952 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Virtual Network Tap configuration. */ +@Fluent +public final class NetworkInterfaceTapConfigurationPropertiesFormatInner { + /* + * The reference to the Virtual Network Tap resource. + */ + @JsonProperty(value = "virtualNetworkTap") + private VirtualNetworkTapInner virtualNetworkTap; + + /* + * The provisioning state of the network interface tap configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..00fb8317291b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerCommitInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Manager Commit. */ +@Fluent +public final class NetworkManagerCommitInner { + /* + * Commit Id. + */ + @JsonProperty(value = "commitId", access = JsonProperty.Access.WRITE_ONLY) + private String commitId; + + /* + * List of target locations. + */ + @JsonProperty(value = "targetLocations", required = true) + private List targetLocations; + + /* + * List of configuration ids. + */ + @JsonProperty(value = "configurationIds") + private List configurationIds; + + /* + * Commit Type. + */ + @JsonProperty(value = "commitType", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetLocations in model NetworkManagerCommitInner")); + } + if (commitType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property commitType in model NetworkManagerCommitInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerCommitInner.class); +} 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..ce2a6058bacfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionInner.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Network Manager Connection resource. */ +@Fluent +public final class NetworkManagerConnectionInner extends ChildResource { + /* + * The scope connection properties + */ + @JsonProperty(value = "properties") + private NetworkManagerConnectionProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..246f146e5d095 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about the network manager connection. */ +@Fluent +public final class NetworkManagerConnectionProperties { + /* + * Network Manager Id. + */ + @JsonProperty(value = "networkManagerId") + private String networkManagerId; + + /* + * Connection state. + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ScopeConnectionState connectionState; + + /* + * A description of the network manager connection. + */ + @JsonProperty(value = "description") + 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() { + } +} 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..d8f9ac05b9e9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerDeploymentStatusListResultInner.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.Fluent; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Network Manager Deployment Status. */ +@Fluent +public final class NetworkManagerDeploymentStatusListResultInner { + /* + * Gets a page of Network Manager Deployment Status + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "skipToken") + 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()); + } + } +} 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..b1bc6f89bbf79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveConnectivityConfigurationListResultInner.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.Fluent; +import com.azure.resourcemanager.network.generated.models.EffectiveConnectivityConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of NetworkManagerEffectiveConnectivityConfiguration + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "skipToken") + 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()); + } + } +} 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..6c40bd7826f07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveSecurityAdminRulesListResultInner.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.Fluent; +import com.azure.resourcemanager.network.generated.models.EffectiveBaseSecurityAdminRule; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of NetworkManagerEffectiveSecurityAdminRules + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "skipToken") + 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()); + } + } +} 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..bee9554fd11f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerInner.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The Managed Network resource. */ +@Fluent +public final class NetworkManagerInner extends Resource { + /* + * The network manager properties + */ + @JsonProperty(value = "properties") + private NetworkManagerProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..02b046949ec28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerProperties.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.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Managed Network. */ +@Fluent +public final class NetworkManagerProperties { + /* + * A description of the network manager. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Scope of Network Manager. + */ + @JsonProperty(value = "networkManagerScopes", required = true) + private NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes; + + /* + * Scope Access. + */ + @JsonProperty(value = "networkManagerScopeAccesses", required = true) + private List networkManagerScopeAccesses; + + /* + * The provisioning state of the network manager resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkManagerScopes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkManagerScopes in model NetworkManagerProperties")); + } else { + networkManagerScopes().validate(); + } + if (networkManagerScopeAccesses() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkManagerScopeAccesses in model NetworkManagerProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerProperties.class); +} 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..141b46b0ff618 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.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.Resource; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Network profile resource. */ +@Fluent +public final class NetworkProfileInner extends Resource { + /* + * Network profile properties. + */ + @JsonProperty(value = "properties") + private NetworkProfilePropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..632a833ddefcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfilePropertiesFormat.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.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network profile properties. */ +@Fluent +public final class NetworkProfilePropertiesFormat { + /* + * List of child container network interfaces. + */ + @JsonProperty(value = "containerNetworkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List containerNetworkInterfaces; + + /* + * List of chid container network interface configurations. + */ + @JsonProperty(value = "containerNetworkInterfaceConfigurations") + private List containerNetworkInterfaceConfigurations; + + /* + * The resource GUID property of the network profile resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network profile resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..e8e35647cbac9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.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.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkSecurityGroup resource. */ +@Fluent +public final class NetworkSecurityGroupInner extends Resource { + /* + * Properties of the network security group. + */ + @JsonProperty(value = "properties") + private NetworkSecurityGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..a269140a572be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupPropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Security Group resource. */ +@Fluent +public final class NetworkSecurityGroupPropertiesFormat { + /* + * When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. + * Initial enablement will trigger re-evaluation. + */ + @JsonProperty(value = "flushConnection") + private Boolean flushConnection; + + /* + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /* + * The default security rules of network security group. + */ + @JsonProperty(value = "defaultSecurityRules", access = JsonProperty.Access.WRITE_ONLY) + private List defaultSecurityRules; + + /* + * A collection of references to network interfaces. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * A collection of references to flow log resources. + */ + @JsonProperty(value = "flowLogs", access = JsonProperty.Access.WRITE_ONLY) + private List flowLogs; + + /* + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the network security group resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..df5878d25ffc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.PartnerManagedResourceProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkVirtualAppliance Resource. */ +@Fluent +public final class NetworkVirtualApplianceInner extends Resource { + /* + * Properties of the Network Virtual Appliance. + */ + @JsonProperty(value = "properties") + private NetworkVirtualAppliancePropertiesFormat innerProperties; + + /* + * The service principal that has read access to cloud-init and config blob. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + public List virtualApplianceSites() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceSites(); + } + + /** + * 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(); + } + } +} 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..212a4261ba8ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.PartnerManagedResourceProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Virtual Appliance definition. */ +@Fluent +public final class NetworkVirtualAppliancePropertiesFormat { + /* + * Network Virtual Appliance SKU. + */ + @JsonProperty(value = "nvaSku") + private VirtualApplianceSkuProperties nvaSku; + + /* + * Address Prefix. + */ + @JsonProperty(value = "addressPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String addressPrefix; + + /* + * BootStrapConfigurationBlobs storage URLs. + */ + @JsonProperty(value = "bootStrapConfigurationBlobs") + private List bootStrapConfigurationBlobs; + + /* + * The Virtual Hub where Network Virtual Appliance is being deployed. + */ + @JsonProperty(value = "virtualHub") + private SubResource virtualHub; + + /* + * CloudInitConfigurationBlob storage URLs. + */ + @JsonProperty(value = "cloudInitConfigurationBlobs") + private List cloudInitConfigurationBlobs; + + /* + * CloudInitConfiguration string in plain text. + */ + @JsonProperty(value = "cloudInitConfiguration") + private String cloudInitConfiguration; + + /* + * VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. + */ + @JsonProperty(value = "virtualApplianceAsn") + private Long virtualApplianceAsn; + + /* + * Public key for SSH login. + */ + @JsonProperty(value = "sshPublicKey") + private String sshPublicKey; + + /* + * List of Virtual Appliance Network Interfaces. + */ + @JsonProperty(value = "virtualApplianceNics", access = JsonProperty.Access.WRITE_ONLY) + private List virtualApplianceNics; + + /* + * List of references to VirtualApplianceSite. + */ + @JsonProperty(value = "virtualApplianceSites", access = JsonProperty.Access.WRITE_ONLY) + private List virtualApplianceSites; + + /* + * List of references to InboundSecurityRules. + */ + @JsonProperty(value = "inboundSecurityRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundSecurityRules; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The deployment type. PartnerManaged for the SaaS NVA + */ + @JsonProperty(value = "deploymentType", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentType; + + /* + * The delegation for the Virtual Appliance + */ + @JsonProperty(value = "delegation") + private DelegationProperties delegation; + + /* + * The delegation for the Virtual Appliance + */ + @JsonProperty(value = "partnerManagedResource") + 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 virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + public List virtualApplianceSites() { + return this.virtualApplianceSites; + } + + /** + * Get the inboundSecurityRules property: List of references to InboundSecurityRules. + * + * @return the inboundSecurityRules value. + */ + public List inboundSecurityRules() { + return this.inboundSecurityRules; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the 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 (delegation() != null) { + delegation().validate(); + } + if (partnerManagedResource() != null) { + partnerManagedResource().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.java new file mode 100644 index 0000000000000..b855988515fa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.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.management.Resource; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Available NetworkVirtualApplianceSkus + * + *

Definition of the NetworkVirtualApplianceSkus resource. + */ +@Fluent +public final class NetworkVirtualApplianceSkuInner extends Resource { + /* + * Network Virtual Appliance Sku Properties + * + * NetworkVirtualApplianceSku properties. + */ + @JsonProperty(value = "properties") + private NetworkVirtualApplianceSkuPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of NetworkVirtualApplianceSkuInner class. */ + public NetworkVirtualApplianceSkuInner() { + } + + /** + * Get the innerProperties property: Network Virtual Appliance Sku Properties + * + *

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; + } + + /** {@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(); + } + } +} 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..db6fab385ed3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuPropertiesFormat.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.Fluent; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Network Virtual Appliance Sku Properties + * + *

Properties specific to NetworkVirtualApplianceSkus. + */ +@Fluent +public final class NetworkVirtualApplianceSkuPropertiesFormat { + /* + * Network Virtual Appliance Sku vendor. + */ + @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) + private String vendor; + + /* + * Available Network Virtual Appliance versions. + */ + @JsonProperty(value = "availableVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableVersions; + + /* + * The list of scale units available. + */ + @JsonProperty(value = "availableScaleUnits") + 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()); + } + } +} 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..d432d98998d32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.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.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the network watcher. + */ + @JsonProperty(value = "properties") + private NetworkWatcherPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..89d292f7c8a9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network watcher properties. */ +@Immutable +public final class NetworkWatcherPropertiesFormat { + /* + * The provisioning state of the network watcher resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..6400bc2d84a20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.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.resourcemanager.network.generated.models.NextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information about next hop from the specified VM. */ +@Fluent +public final class NextHopResultInner { + /* + * Next hop type. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /* + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /* + * The resource identifier for the route table associated with the route being returned. If the route being + * returned does not correspond to any user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** 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() { + } +} 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..1d75b17f8b28e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.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.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network REST API operation definition. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation properties format. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..a4d2bd89bdb14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationPropertiesFormat.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of operation properties format. */ +@Fluent +public final class OperationPropertiesFormat { + /* + * Specification of the service. + */ + @JsonProperty(value = "serviceSpecification") + 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(); + } + } +} 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..a065557a50436 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.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.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Outbound rule of the load balancer. */ +@Fluent +public final class OutboundRuleInner extends SubResource { + /* + * Properties of load balancer outbound rule. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..3c73eb84f9608 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRulePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Outbound rule of the load balancer. */ +@Fluent +public final class OutboundRulePropertiesFormat { + /* + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /* + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "frontendIPConfigurations", required = true) + private List frontendIpConfigurations; + + /* + * A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "backendAddressPool", required = true) + private SubResource backendAddressPool; + + /* + * The provisioning state of the outbound rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The protocol for the outbound rule in load balancer. + */ + @JsonProperty(value = "protocol", required = true) + private LoadBalancerOutboundRuleProtocol protocol; + + /* + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is + * only used when the protocol is set to TCP. + */ + @JsonProperty(value = "enableTcpReset") + private Boolean enableTcpReset; + + /* + * The timeout for the TCP idle connection. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property frontendIpConfigurations in model OutboundRulePropertiesFormat")); + } + if (backendAddressPool() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backendAddressPool in model OutboundRulePropertiesFormat")); + } + if (protocol() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model OutboundRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OutboundRulePropertiesFormat.class); +} 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..9380f43596d0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for P2SConnectionConfiguration. */ +@Fluent +public final class P2SConnectionConfigurationProperties { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + @JsonProperty(value = "routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /* + * Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. + */ + @JsonProperty(value = "enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. + */ + @JsonProperty(value = "configurationPolicyGroupAssociations", access = JsonProperty.Access.WRITE_ONLY) + private List configurationPolicyGroupAssociations; + + /* + * List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. + */ + @JsonProperty(value = "previousConfigurationPolicyGroupAssociations", access = JsonProperty.Access.WRITE_ONLY) + private List previousConfigurationPolicyGroupAssociations; + + /* + * The provisioning state of the P2SConnectionConfiguration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..45e1f35015e07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** P2S Vpn connection detailed health written to sas url. */ +@Fluent +public final class P2SVpnConnectionHealthInner { + /* + * Returned sas url of the blob to which the p2s vpn connection detailed health will be written. + */ + @JsonProperty(value = "sasUrl") + 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() { + } +} 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..a60234b20b8e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** P2SVpnGateway Resource. */ +@Fluent +public final class P2SVpnGatewayInner extends Resource { + /* + * Properties of the P2SVpnGateway. + */ + @JsonProperty(value = "properties") + private P2SVpnGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..21c782c6edc76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayProperties.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for P2SVpnGateway. */ +@Fluent +public final class P2SVpnGatewayProperties { + /* + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "virtualHub") + private SubResource virtualHub; + + /* + * List of all p2s connection configurations of the gateway. + */ + @JsonProperty(value = "p2SConnectionConfigurations") + private List p2SConnectionConfigurations; + + /* + * The provisioning state of the P2S VPN gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The scale unit for this p2s vpn gateway. + */ + @JsonProperty(value = "vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /* + * The VpnServerConfiguration to which the p2sVpnGateway is attached to. + */ + @JsonProperty(value = "vpnServerConfiguration") + private SubResource vpnServerConfiguration; + + /* + * All P2S VPN clients' connection health status. + */ + @JsonProperty(value = "vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY) + private VpnClientConnectionHealth vpnClientConnectionHealth; + + /* + * List of all customer specified DNS servers IP addresses. + */ + @JsonProperty(value = "customDnsServers") + private List customDnsServers; + + /* + * Enable Routing Preference property for the Public IP Interface of the P2SVpnGateway. + */ + @JsonProperty(value = "isRoutingPreferenceInternet") + 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(); + } + } +} 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..fca3edd0ff978 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PacketCaptureTargetType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the create packet capture operation. */ +@Fluent +public class PacketCaptureParameters { + /* + * The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. + */ + @JsonProperty(value = "target", required = true) + 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. + */ + @JsonProperty(value = "scope") + private PacketCaptureMachineScope scope; + + /* + * Target type of the resource provided. + */ + @JsonProperty(value = "targetType") + private PacketCaptureTargetType targetType; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + @JsonProperty(value = "filters") + private List filters; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model PacketCaptureParameters")); + } + if (scope() != null) { + scope().validate(); + } + if (storageLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageLocation in model PacketCaptureParameters")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PacketCaptureParameters.class); +} 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..ec0fbd73102f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Status of packet capture session. */ +@Fluent +public final class PacketCaptureQueryStatusResultInner { + /* + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private OffsetDateTime captureStartTime; + + /* + * The status of the packet capture session. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /* + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /* + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** 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() { + } +} 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..b61cce1ca00b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.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.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about packet capture session. */ +@Fluent +public final class PacketCaptureResultInner { + /* + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the packet capture result. + */ + @JsonProperty(value = "properties") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..85d529020e23c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultProperties.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.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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..a99d5c7edb466 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.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.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@Fluent +public final class PeerExpressRouteCircuitConnectionInner extends SubResource { + /* + * Properties of the peer express route circuit connection. + */ + @JsonProperty(value = "properties") + private PeerExpressRouteCircuitConnectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..bf2e633021659 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionPropertiesFormat.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.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the peer express route circuit connection. */ +@Fluent +public final class PeerExpressRouteCircuitConnectionPropertiesFormat { + /* + * Reference to Express Route Circuit Private Peering Resource of the circuit. + */ + @JsonProperty(value = "expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the peered circuit. + */ + @JsonProperty(value = "peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The name of the express route circuit connection resource. + */ + @JsonProperty(value = "connectionName") + private String connectionName; + + /* + * The resource guid of the authorization used for the express route circuit connection. + */ + @JsonProperty(value = "authResourceGuid") + private String authResourceGuid; + + /* + * The provisioning state of the peer express route circuit connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java new file mode 100644 index 0000000000000..cf0cb6d6db389 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual router peer routes. */ +@Fluent +public final class PeerRouteListInner { + /* + * List of peer routes. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PeerRouteListInner class. */ + public PeerRouteListInner() { + } + + /** + * Get the value property: List of peer routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of peer routes. + * + * @param value the value value to set. + * @return the PeerRouteListInner object itself. + */ + public PeerRouteListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java new file mode 100644 index 0000000000000..bb2efff249119 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the private dns zone group. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..fd5f67d4101c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private dns zone group. */ +@Fluent +public final class PrivateDnsZoneGroupPropertiesFormat { + /* + * The provisioning state of the private dns zone group resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A collection of private dns zone configurations of the private dns zone group. + */ + @JsonProperty(value = "privateDnsZoneConfigs") + 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()); + } + } +} 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..a0efd2e283569 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.RecordSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private dns zone configuration resource. */ +@Fluent +public final class PrivateDnsZonePropertiesFormat { + /* + * The resource id of the private dns zone. + */ + @JsonProperty(value = "privateDnsZoneId") + private String privateDnsZoneId; + + /* + * A collection of information regarding a recordSet, holding information to identify private resources. + */ + @JsonProperty(value = "recordSets", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..429ef9ca6a327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.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.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpointConnection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends SubResource { + /* + * Properties of the private end point connection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionPropertiesInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..6fafdc90d465d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionPropertiesInner.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionPropertiesInner { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + @JsonProperty(value = "linkIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String linkIdentifier; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java new file mode 100644 index 0000000000000..4385b8d47ef29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Properties of the private endpoint. + */ + @JsonProperty(value = "properties") + private PrivateEndpointPropertiesInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..f1dffc5e47a77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointIpConfigurationProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an IP Configuration of the private endpoint. */ +@Fluent +public final class PrivateEndpointIpConfigurationProperties { + /* + * The ID of a group obtained from the remote resource that this private endpoint should connect to. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The member name of a group obtained from the remote resource that this private endpoint should connect to. + */ + @JsonProperty(value = "memberName") + private String memberName; + + /* + * A private ip address obtained from the private endpoint's subnet. + */ + @JsonProperty(value = "privateIPAddress") + 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() { + } +} 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..3b5f88b1c1b70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.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.models; + +import com.azure.core.annotation.Fluent; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint. */ +@Fluent +public final class PrivateEndpointPropertiesInner { + /* + * The ID of the subnet from which the private IP will be allocated. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * An array of references to the network interfaces created for this private endpoint. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * The provisioning state of the private endpoint resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A grouping of information about the connection to the remote resource. + */ + @JsonProperty(value = "privateLinkServiceConnections") + private List privateLinkServiceConnections; + + /* + * A grouping of information about the connection to the remote resource. Used when the network admin does not have + * access to approve connections to the remote resource. + */ + @JsonProperty(value = "manualPrivateLinkServiceConnections") + private List manualPrivateLinkServiceConnections; + + /* + * An array of custom dns configurations. + */ + @JsonProperty(value = "customDnsConfigs") + private List customDnsConfigs; + + /* + * Application security groups in which the private endpoint IP configuration is included. + */ + @JsonProperty(value = "applicationSecurityGroups") + 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. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * The custom name of the network interface attached to the private endpoint. + */ + @JsonProperty(value = "customNetworkInterfaceName") + 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()); + } + } +} 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..c2b4220b799fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.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.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the PrivateLinkServiceConnection. */ +@Fluent +public final class PrivateLinkServiceConnectionProperties { + /* + * The provisioning state of the private link service connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource id of private link service. + */ + @JsonProperty(value = "privateLinkServiceId") + private String privateLinkServiceId; + + /* + * The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /* + * A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. + */ + @JsonProperty(value = "requestMessage") + private String requestMessage; + + /* + * A collection of read-only information about the state of the connection to the remote resource. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + 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(); + } + } +} 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..022a3ea351ce0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.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.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Properties of the private link service. + */ + @JsonProperty(value = "properties") + private PrivateLinkServiceProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 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(); + } + } +} 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..eca2309a2a18e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private link service ip configuration. */ +@Fluent +public final class PrivateLinkServiceIpConfigurationInner extends SubResource { + /* + * Properties of the private link service ip configuration. + */ + @JsonProperty(value = "properties") + private PrivateLinkServiceIpConfigurationPropertiesInner innerProperties; + + /* + * The name of private link service ip configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..4a19dbc2c2d20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationPropertiesInner.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.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of private link service IP configuration. */ +@Fluent +public final class PrivateLinkServiceIpConfigurationPropertiesInner { + /* + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubnetInner subnet; + + /* + * Whether the ip configuration is primary or not. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The provisioning state of the private link service IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + @JsonProperty(value = "privateIPAddressVersion") + 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(); + } + } +} 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..cfa98c2f320a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.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.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private link service. */ +@Fluent +public final class PrivateLinkServiceProperties { + /* + * An array of references to the load balancer IP configurations. + */ + @JsonProperty(value = "loadBalancerFrontendIpConfigurations") + private List loadBalancerFrontendIpConfigurations; + + /* + * An array of private link service IP configurations. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * An array of references to the network interfaces created for this private link service. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * The provisioning state of the private link service resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * An array of list about connections to the private endpoint. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The visibility list of the private link service. + */ + @JsonProperty(value = "visibility") + private PrivateLinkServicePropertiesVisibility visibility; + + /* + * The auto-approval list of the private link service. + */ + @JsonProperty(value = "autoApproval") + private PrivateLinkServicePropertiesAutoApproval autoApproval; + + /* + * The list of Fqdn. + */ + @JsonProperty(value = "fqdns") + private List fqdns; + + /* + * The alias of the private link service. + */ + @JsonProperty(value = "alias", access = JsonProperty.Access.WRITE_ONLY) + private String alias; + + /* + * Whether the private link service is enabled for proxy protocol or not. + */ + @JsonProperty(value = "enableProxyProtocol") + 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 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(); + } + } +} 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..3d0c4880cc2dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class PrivateLinkServiceVisibilityInner { + /* + * Private Link Service Visibility (True/False). + */ + @JsonProperty(value = "visible") + 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() { + } +} 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..1a10b8930f22d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A load balancer probe. */ +@Fluent +public final class ProbeInner extends SubResource { + /* + * Properties of load balancer probe. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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 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(); + } + } +} 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..dca6daff55c47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Load balancer probe resource. */ +@Fluent +public final class ProbePropertiesFormat { + /* + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /* + * The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. + * If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be + * successful. + */ + @JsonProperty(value = "protocol", required = true) + private ProbeProtocol protocol; + + /* + * The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + */ + @JsonProperty(value = "port", required = true) + 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. + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /* + * The number of probes where if no response, will result in stopping further traffic from being delivered to the + * endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used + * in Azure. + */ + @JsonProperty(value = "numberOfProbes") + 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. + */ + @JsonProperty(value = "probeThreshold") + 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. + */ + @JsonProperty(value = "requestPath") + private String requestPath; + + /* + * The provisioning state of the probe resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property protocol in model ProbePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProbePropertiesFormat.class); +} 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..ede38ab6ff9f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressMigrationPhase; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /* + * Public IP address properties. + */ + @JsonProperty(value = "properties") + private PublicIpAddressPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..bcd514a7160f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressPropertiesFormatInner.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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP address properties. */ +@Fluent +public final class PublicIpAddressPropertiesFormatInner { + /* + * The public IP address allocation method. + */ + @JsonProperty(value = "publicIPAllocationMethod") + private IpAllocationMethod publicIpAllocationMethod; + + /* + * The public IP address version. + */ + @JsonProperty(value = "publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IpConfigurationInner ipConfiguration; + + /* + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "dnsSettings") + private PublicIpAddressDnsSettings dnsSettings; + + /* + * The DDoS protection custom policy associated with the public IP address. + */ + @JsonProperty(value = "ddosSettings") + private DdosSettings ddosSettings; + + /* + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "ipTags") + private List ipTags; + + /* + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The Public IP Prefix this Public IP Address should be allocated from. + */ + @JsonProperty(value = "publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The resource GUID property of the public IP address resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the public IP address resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The service public IP address of the public IP address resource. + */ + @JsonProperty(value = "servicePublicIPAddress") + private PublicIpAddressInner servicePublicIpAddress; + + /* + * The NatGateway for the Public IP address. + */ + @JsonProperty(value = "natGateway") + private NatGatewayInner natGateway; + + /* + * Migration phase of Public IP Address. + */ + @JsonProperty(value = "migrationPhase") + private PublicIpAddressMigrationPhase migrationPhase; + + /* + * The linked public IP address of the public IP address resource. + */ + @JsonProperty(value = "linkedPublicIPAddress") + private PublicIpAddressInner linkedPublicIpAddress; + + /* + * Specify what happens to the public IP address when the VM using it is deleted + */ + @JsonProperty(value = "deleteOption") + 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(); + } + } +} 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..99289b42335fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpDdosProtectionStatusResultInner.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.resourcemanager.network.generated.models.IsWorkloadProtected; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GetPublicIpAddressDdosProtectionStatusOperation API service call. */ +@Fluent +public final class PublicIpDdosProtectionStatusResultInner { + /* + * Public IP ARM resource ID + */ + @JsonProperty(value = "publicIpAddressId") + private String publicIpAddressId; + + /* + * IP Address of the Public IP Resource + */ + @JsonProperty(value = "publicIpAddress") + private String publicIpAddress; + + /* + * Value indicating whether the IP address is DDoS workload protected or not. + */ + @JsonProperty(value = "isWorkloadProtected") + private IsWorkloadProtected isWorkloadProtected; + + /* + * DDoS protection plan Resource Id of a if IP address is protected through a plan. + */ + @JsonProperty(value = "ddosProtectionPlanId") + 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() { + } +} 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..d11b774bdbf90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.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.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIpPrefixSku sku; + + /* + * Public IP prefix properties. + */ + @JsonProperty(value = "properties") + private PublicIpPrefixPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..1b3ebd5d3e028 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixPropertiesFormatInner.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP prefix properties. */ +@Fluent +public final class PublicIpPrefixPropertiesFormatInner { + /* + * The public IP address version. + */ + @JsonProperty(value = "publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * The list of tags associated with the public IP prefix. + */ + @JsonProperty(value = "ipTags") + private List ipTags; + + /* + * The Length of the Public IP Prefix. + */ + @JsonProperty(value = "prefixLength") + private Integer prefixLength; + + /* + * The allocated Prefix. + */ + @JsonProperty(value = "ipPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String ipPrefix; + + /* + * The list of all referenced PublicIPAddresses. + */ + @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * The reference to load balancer frontend IP configuration associated with the public IP prefix. + */ + @JsonProperty(value = "loadBalancerFrontendIpConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource loadBalancerFrontendIpConfiguration; + + /* + * The customIpPrefix that this prefix is associated with. + */ + @JsonProperty(value = "customIPPrefix") + private SubResource customIpPrefix; + + /* + * The resource GUID property of the public IP prefix resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the public IP prefix resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * NatGateway of Public IP Prefix. + */ + @JsonProperty(value = "natGateway") + 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(); + } + } +} 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..a12f2afc05111 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/QueryResultsInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.SingleQueryResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Query result. */ +@Fluent +public final class QueryResultsInner { + /* + * Number of total records matching the query. + */ + @JsonProperty(value = "matchingRecordsCount") + private Long matchingRecordsCount; + + /* + * Array containing the results of the query + */ + @JsonProperty(value = "signatures") + 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()); + } + } +} 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..56d4f8215018e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinkFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of ResourceNavigationLink. */ +@Fluent +public final class ResourceNavigationLinkFormat { + /* + * Resource type of the linked resource. + */ + @JsonProperty(value = "linkedResourceType") + private String linkedResourceType; + + /* + * Link to the external resource. + */ + @JsonProperty(value = "link") + private String link; + + /* + * The provisioning state of the resource navigation link resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..63f0381b75435 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ResourceNavigationLinks_List operation. */ +@Fluent +public final class ResourceNavigationLinksListResultInner { + /* + * The resource navigation links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..45ed61bd7e6b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.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.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route Filter Resource. */ +@Fluent +public final class RouteFilterInner extends Resource { + /* + * Properties of the route filter. + */ + @JsonProperty(value = "properties") + private RouteFilterPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..bb34c34e2189c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterPropertiesFormat.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Resource. */ +@Fluent +public final class RouteFilterPropertiesFormat { + /* + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "peerings", access = JsonProperty.Access.WRITE_ONLY) + private List peerings; + + /* + * A collection of references to express route circuit ipv6 peerings. + */ + @JsonProperty(value = "ipv6Peerings", access = JsonProperty.Access.WRITE_ONLY) + private List ipv6Peerings; + + /* + * The provisioning state of the route filter resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..295f92bf23fab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.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.management.SubResource; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Rule Resource. */ +@Fluent +public final class RouteFilterRuleInner extends SubResource { + /* + * Properties of the route filter rule. + */ + @JsonProperty(value = "properties") + private RouteFilterRulePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..2f4c80a608888 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRulePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Rule Resource. */ +@Fluent +public final class RouteFilterRulePropertiesFormat { + /* + * The access type of the rule. + */ + @JsonProperty(value = "access", required = true) + private Access access; + + /* + * The rule type of the rule. + */ + @JsonProperty(value = "routeFilterRuleType", required = true) + private RouteFilterRuleType routeFilterRuleType; + + /* + * The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "communities", required = true) + private List communities; + + /* + * The provisioning state of the route filter rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property access in model RouteFilterRulePropertiesFormat")); + } + if (routeFilterRuleType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property routeFilterRuleType in model RouteFilterRulePropertiesFormat")); + } + if (communities() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property communities in model RouteFilterRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RouteFilterRulePropertiesFormat.class); +} 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..e829f2ae877d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route resource. */ +@Fluent +public final class RouteInner extends SubResource { + /* + * Properties of the route. + */ + @JsonProperty(value = "properties") + private RoutePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** 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(); + } + + /** + * Set the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @param hasBgpOverride the hasBgpOverride value to set. + * @return the RouteInner object itself. + */ + public RouteInner withHasBgpOverride(Boolean hasBgpOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + this.innerProperties().withHasBgpOverride(hasBgpOverride); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..091ab3438e3a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RouteMap child resource of a Virtual hub. */ +@Fluent +public final class RouteMapInner extends SubResource { + /* + * Properties of the RouteMap resource. + */ + @JsonProperty(value = "properties") + private RouteMapProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..1c0e19be6602f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapProperties.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of RouteMap resource. */ +@Fluent +public final class RouteMapProperties { + /* + * List of connections which have this RoutMap associated for inbound traffic. + */ + @JsonProperty(value = "associatedInboundConnections") + private List associatedInboundConnections; + + /* + * List of connections which have this RoutMap associated for outbound traffic. + */ + @JsonProperty(value = "associatedOutboundConnections") + private List associatedOutboundConnections; + + /* + * List of RouteMap rules to be applied. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The provisioning state of the RouteMap resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..6ed8933cb7fac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route resource. */ +@Fluent +public final class RoutePropertiesFormat { + /* + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * The type of Azure hop the packet should be sent to. + */ + @JsonProperty(value = "nextHopType", required = true) + private RouteNextHopType nextHopType; + + /* + * The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop + * type is VirtualAppliance. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /* + * The provisioning state of the route resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A value indicating whether this route overrides overlapping BGP routes regardless of LPM. + */ + @JsonProperty(value = "hasBgpOverride") + 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; + } + + /** + * Set the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @param hasBgpOverride the hasBgpOverride value to set. + * @return the RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat withHasBgpOverride(Boolean hasBgpOverride) { + this.hasBgpOverride = hasBgpOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nextHopType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextHopType in model RoutePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutePropertiesFormat.class); +} 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..a9071922201ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route table resource. */ +@Fluent +public final class RouteTableInner extends Resource { + /* + * Properties of the route table. + */ + @JsonProperty(value = "properties") + private RouteTablePropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..111b57227b141 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTablePropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Table resource. */ +@Fluent +public final class RouteTablePropertiesFormat { + /* + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "routes") + private List routes; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * Whether to disable the routes learned by BGP on that route table. True means disable. + */ + @JsonProperty(value = "disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /* + * The provisioning state of the route table resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the route table. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..9bf6ba188c068 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private RoutingIntentProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..500f121c85c09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a RoutingIntent resource. */ +@Fluent +public final class RoutingIntentProperties { + /* + * List of routing policies. + */ + @JsonProperty(value = "routingPolicies") + private List routingPolicies; + + /* + * The provisioning state of the RoutingIntent resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..dbeac5c4b029d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionInner.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Scope Connections resource. */ +@Fluent +public final class ScopeConnectionInner extends ChildResource { + /* + * The scope connection properties + */ + @JsonProperty(value = "properties") + private ScopeConnectionProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..03375c4470fba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionProperties.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.resourcemanager.network.generated.models.ScopeConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Scope connection. */ +@Fluent +public final class ScopeConnectionProperties { + /* + * Tenant ID. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Resource ID. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Connection State + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ScopeConnectionState connectionState; + + /* + * A description of the scope connection. + */ + @JsonProperty(value = "description") + 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() { + } +} 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..8383feb8f04b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private SecurityAdminConfigurationPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..51708ab4c1eb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationPropertiesFormat.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.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the security admin configuration properties. */ +@Fluent +public final class SecurityAdminConfigurationPropertiesFormat { + /* + * A description of the security configuration. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Enum list of network intent policy based services. + */ + @JsonProperty(value = "applyOnNetworkIntentPolicyBasedServices") + private List applyOnNetworkIntentPolicyBasedServices; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..19534d69f258d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The information about security rules applied to the specified VM. */ +@Fluent +public final class SecurityGroupViewResultInner { + /* + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + 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()); + } + } +} 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..dfcbf2c6767b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Security Partner Provider resource. */ +@Fluent +public final class SecurityPartnerProviderInner extends Resource { + /* + * Properties of the Security Partner Provider. + */ + @JsonProperty(value = "properties") + private SecurityPartnerProviderPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..6711195f8cd29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Security Partner Provider. */ +@Fluent +public final class SecurityPartnerProviderPropertiesFormat { + /* + * The provisioning state of the Security Partner Provider resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The security provider name. + */ + @JsonProperty(value = "securityProviderName") + private SecurityProviderName securityProviderName; + + /* + * The connection status with the Security Partner Provider. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private SecurityPartnerProviderConnectionStatus connectionStatus; + + /* + * The virtualHub to which the Security Partner Provider belongs. + */ + @JsonProperty(value = "virtualHub") + 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() { + } +} 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..f4e59faa7923c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network security rule. */ +@Fluent +public final class SecurityRuleInner extends SubResource { + /* + * Properties of the security rule. + */ + @JsonProperty(value = "properties") + private SecurityRulePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** 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(); + } + } +} 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..a5bcfcc32eff8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRulePropertiesFormat.java @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security rule resource. */ +@Fluent +public final class SecurityRulePropertiesFormat { + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Network protocol this rule applies to. + */ + @JsonProperty(value = "protocol", required = true) + private SecurityRuleProtocol protocol; + + /* + * The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all + * ports. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /* + * The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all + * ports. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /* + * The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /* + * The application security group specified as source. + */ + @JsonProperty(value = "sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /* + * The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /* + * The application security group specified as destination. + */ + @JsonProperty(value = "destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /* + * The source port ranges. + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * The network traffic is allowed or denied. + */ + @JsonProperty(value = "access", required = true) + private SecurityRuleAccess access; + + /* + * The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each + * rule in the collection. The lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. + */ + @JsonProperty(value = "direction", required = true) + private SecurityRuleDirection direction; + + /* + * The provisioning state of the security rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @param priority the priority value to set. + * @return the SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @return the direction value. + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @param direction the direction value to set. + * @return the 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 + .logExceptionAsError( + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property access in model SecurityRulePropertiesFormat")); + } + if (direction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model SecurityRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityRulePropertiesFormat.class); +} 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..a061fd1e7abb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinkPropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ServiceAssociationLink. */ +@Fluent +public final class ServiceAssociationLinkPropertiesFormat { + /* + * Resource type of the linked resource. + */ + @JsonProperty(value = "linkedResourceType") + private String linkedResourceType; + + /* + * Link to the external resource. + */ + @JsonProperty(value = "link") + private String link; + + /* + * The provisioning state of the service association link resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * If true, the resource can be deleted. + */ + @JsonProperty(value = "allowDelete") + private Boolean allowDelete; + + /* + * A list of locations. + */ + @JsonProperty(value = "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() { + } +} 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..be12582c82b5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ServiceAssociationLinks_List operation. */ +@Fluent +public final class ServiceAssociationLinksListResultInner { + /* + * The service association links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..890e793a9a006 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceDelegationPropertiesFormat.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.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a service delegation. */ +@Fluent +public final class ServiceDelegationPropertiesFormat { + /* + * The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions", access = JsonProperty.Access.WRITE_ONLY) + private List actions; + + /* + * The provisioning state of the service delegation resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..58401087b9b66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint policy definitions. */ +@Fluent +public final class ServiceEndpointPolicyDefinitionInner extends SubResource { + /* + * Properties of the service endpoint policy definition. + */ + @JsonProperty(value = "properties") + private ServiceEndpointPolicyDefinitionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** 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(); + } + } +} 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..eb693132f49cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint policy definition resource. */ +@Fluent +public final class ServiceEndpointPolicyDefinitionPropertiesFormat { + /* + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Service endpoint name. + */ + @JsonProperty(value = "service") + private String service; + + /* + * A list of service resources. + */ + @JsonProperty(value = "serviceResources") + private List serviceResources; + + /* + * The provisioning state of the service endpoint policy definition resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..07b1b5266b701 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.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.Resource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ServiceEndpointPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Kind of service endpoint policy. This is metadata used for the Azure portal experience. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..c610a8112ccee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyPropertiesFormat.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint Policy resource. */ +@Fluent +public final class ServiceEndpointPolicyPropertiesFormat { + /* + * A collection of service endpoint policy definitions of the service endpoint policy. + */ + @JsonProperty(value = "serviceEndpointPolicyDefinitions") + private List serviceEndpointPolicyDefinitions; + + /* + * A collection of references to subnets. + */ + @JsonProperty(value = "subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /* + * The resource GUID property of the service endpoint policy resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the service endpoint policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The alias indicating if the policy belongs to a service + */ + @JsonProperty(value = "serviceAlias") + private String serviceAlias; + + /* + * A collection of contextual service endpoint policy. + */ + @JsonProperty(value = "contextualServiceEndpointPolicies") + 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()); + } + } +} 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..cf187882d04ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagInformationInner.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.resourcemanager.network.generated.models.ServiceTagInformationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The service tag information. */ +@Immutable +public final class ServiceTagInformationInner { + /* + * Properties of the service tag information. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ServiceTagInformationPropertiesFormat properties; + + /* + * The name of service tag. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of service tag. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The iteration number of service tag object for region. + */ + @JsonProperty(value = "serviceTagChangeNumber", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..9a119dd5ff934 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceTags API service call. */ +@Immutable +public final class ServiceTagsListResultInner { + /* + * The name of the cloud. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of the cloud. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The azure resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The name of the cloud. + */ + @JsonProperty(value = "cloud", access = JsonProperty.Access.WRITE_ONLY) + private String cloud; + + /* + * The list of service tag information resources. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The URL to get next page of service tag information resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..1a7f26d959a9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignatureOverridesFilterValuesResponseInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the list of all possible values for a specific filter value. */ +@Fluent +public final class SignatureOverridesFilterValuesResponseInner { + /* + * Describes the possible values + */ + @JsonProperty(value = "filterValues") + 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() { + } +} 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..0fcf036f9aaaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.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.management.ProxyResource; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains all specific policy signatures overrides for the IDPS. */ +@Fluent +public final class SignaturesOverridesInner extends ProxyResource { + /* + * Contains the name of the resource (default) + */ + @JsonProperty(value = "name") + private String name; + + /* + * Will contain the resource id of the signature override resource + */ + @JsonProperty(value = "id") + private String id; + + /* + * Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + */ + @JsonProperty(value = "type") + private String type; + + /* + * Will contain the properties of the resource (the actual signature overrides) + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..cea5f20e742be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an object containing an array with a single item. */ +@Fluent +public final class SignaturesOverridesListInner { + /* + * Describes a list consisting exactly one item describing the policy's signature override status + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..6ea9f4277011d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberInner.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StaticMember Item. */ +@Fluent +public final class StaticMemberInner extends ChildResource { + /* + * The Static Member properties + */ + @JsonProperty(value = "properties") + private StaticMemberProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..092735a7be4ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of static member. */ +@Fluent +public final class StaticMemberProperties { + /* + * Resource Id. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Resource region. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The provisioning state of the scope assignment resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..1eab10e776647 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet in a virtual network resource. */ +@Fluent +public final class SubnetInner extends SubResource { + /* + * Properties of the subnet. + */ + @JsonProperty(value = "properties") + private SubnetPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..0440aa2f6ca83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetPropertiesFormatInner.java @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the subnet. */ +@Fluent +public final class SubnetPropertiesFormatInner { + /* + * The address prefix for the subnet. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * List of address prefixes for the subnet. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * The reference to the RouteTable resource. + */ + @JsonProperty(value = "routeTable") + private RouteTableInner routeTable; + + /* + * Nat gateway associated with this subnet. + */ + @JsonProperty(value = "natGateway") + private SubResource natGateway; + + /* + * An array of service endpoints. + */ + @JsonProperty(value = "serviceEndpoints") + private List serviceEndpoints; + + /* + * An array of service endpoint policies. + */ + @JsonProperty(value = "serviceEndpointPolicies") + private List serviceEndpointPolicies; + + /* + * An array of references to private endpoints. + */ + @JsonProperty(value = "privateEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpoints; + + /* + * An array of references to the network interface IP configurations using subnet. + */ + @JsonProperty(value = "ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * Array of IP configuration profiles which reference this subnet. + */ + @JsonProperty(value = "ipConfigurationProfiles", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurationProfiles; + + /* + * Array of IpAllocation which reference this subnet. + */ + @JsonProperty(value = "ipAllocations") + private List ipAllocations; + + /* + * An array of references to the external resources using subnet. + */ + @JsonProperty(value = "resourceNavigationLinks", access = JsonProperty.Access.WRITE_ONLY) + private List resourceNavigationLinks; + + /* + * An array of references to services injecting into this subnet. + */ + @JsonProperty(value = "serviceAssociationLinks", access = JsonProperty.Access.WRITE_ONLY) + private List serviceAssociationLinks; + + /* + * An array of references to the delegations on the subnet. + */ + @JsonProperty(value = "delegations") + private List delegations; + + /* + * A read-only string identifying the intention of use for this subnet based on delegations and other user-defined + * properties. + */ + @JsonProperty(value = "purpose", access = JsonProperty.Access.WRITE_ONLY) + private String purpose; + + /* + * The provisioning state of the subnet resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Enable or Disable apply network policies on private end point in the subnet. + */ + @JsonProperty(value = "privateEndpointNetworkPolicies") + private VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies; + + /* + * Enable or Disable apply network policies on private link service in the subnet. + */ + @JsonProperty(value = "privateLinkServiceNetworkPolicies") + private VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies; + + /* + * Application gateway IP configurations of virtual network resource. + */ + @JsonProperty(value = "applicationGatewayIpConfigurations") + private List applicationGatewayIpConfigurations; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkSecurityGroup() != null) { + networkSecurityGroup().validate(); + } + if (routeTable() != null) { + routeTable().validate(); + } + if (serviceEndpoints() != null) { + serviceEndpoints().forEach(e -> e.validate()); + } + if (serviceEndpointPolicies() != null) { + serviceEndpointPolicies().forEach(e -> e.validate()); + } + if (privateEndpoints() != null) { + privateEndpoints().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (ipConfigurationProfiles() != null) { + ipConfigurationProfiles().forEach(e -> e.validate()); + } + if (resourceNavigationLinks() != null) { + resourceNavigationLinks().forEach(e -> e.validate()); + } + if (serviceAssociationLinks() != null) { + serviceAssociationLinks().forEach(e -> e.validate()); + } + if (delegations() != null) { + delegations().forEach(e -> e.validate()); + } + if (applicationGatewayIpConfigurations() != null) { + applicationGatewayIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..cd1b2128a6e0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceInner.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.resourcemanager.network.generated.models.SwapResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SwapResource to represent slot type on the specified cloud service. */ +@Fluent +public final class SwapResourceInner { + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Swap resource properties + */ + @JsonProperty(value = "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(); + } + } +} 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..1134acb6520fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceListResultInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SwapResource List with single entry to represent slot type on the specified cloud service. */ +@Fluent +public final class SwapResourceListResultInner { + /* + * The value property. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..601f398f40185 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.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.resourcemanager.network.generated.models.TopologyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Topology of the specified resource group. */ +@Fluent +public final class TopologyInner { + /* + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The datetime when the topology was initially created for the resource group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * A list of topology resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** 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()); + } + } +} 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..7760270355bc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage location provided for troubleshoot. */ +@Fluent +public final class TroubleshootingProperties { + /* + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "storageId", required = true) + private String storageId; + + /* + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "storagePath", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageId in model TroubleshootingProperties")); + } + if (storagePath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storagePath in model TroubleshootingProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TroubleshootingProperties.class); +} 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..4fb7ed975efcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Troubleshooting information gained from specified resource. */ +@Fluent +public final class TroubleshootingResultInner { + /* + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** 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()); + } + } +} 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..2820a34c9cd2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network resource usage. */ +@Fluent +public final class UsageInner { + /* + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private UsageUnit unit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /* + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); +} 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..69967e3672c9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.Access; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Results of IP flow verification on the target resource. */ +@Fluent +public final class VerificationIpFlowResultInner { + /* + * Indicates whether the traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private Access access; + + /* + * Name of the rule. If input is not matched against any security rule, it is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** 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() { + } +} 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..71742afd173f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.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.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@Fluent +public final class VirtualApplianceSiteInner extends SubResource { + /* + * The properties of the Virtual Appliance Sites. + */ + @JsonProperty(value = "properties") + private VirtualApplianceSiteProperties innerProperties; + + /* + * Name of the virtual appliance site. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Site type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..5673e0a66148b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteProperties.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.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the rule group. */ +@Fluent +public final class VirtualApplianceSiteProperties { + /* + * Address Prefix. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Office 365 Policy. + */ + @JsonProperty(value = "o365Policy") + private Office365PolicyProperties o365Policy; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..ebd50bfd99433 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualHub Resource. */ +@Fluent +public final class VirtualHubInner extends Resource { + /* + * Properties of the virtual hub. + */ + @JsonProperty(value = "properties") + private VirtualHubProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..15c77d5d301e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubProperties.java @@ -0,0 +1,561 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualHub. */ +@Fluent +public final class VirtualHubProperties { + /* + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "virtualWan") + private SubResource virtualWan; + + /* + * The VpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "vpnGateway") + private SubResource vpnGateway; + + /* + * The P2SVpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "p2SVpnGateway") + private SubResource p2SVpnGateway; + + /* + * The expressRouteGateway associated with this VirtualHub. + */ + @JsonProperty(value = "expressRouteGateway") + private SubResource expressRouteGateway; + + /* + * The azureFirewall associated with this VirtualHub. + */ + @JsonProperty(value = "azureFirewall") + private SubResource azureFirewall; + + /* + * The securityPartnerProvider associated with this VirtualHub. + */ + @JsonProperty(value = "securityPartnerProvider") + private SubResource securityPartnerProvider; + + /* + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * The routeTable associated with this virtual hub. + */ + @JsonProperty(value = "routeTable") + private VirtualHubRouteTable routeTable; + + /* + * The provisioning state of the virtual hub resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The Security Provider name. + */ + @JsonProperty(value = "securityProviderName") + private String securityProviderName; + + /* + * List of all virtual hub route table v2s associated with this VirtualHub. + */ + @JsonProperty(value = "virtualHubRouteTableV2s") + private List virtualHubRouteTableV2S; + + /* + * The sku of this VirtualHub. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * The routing state. + */ + @JsonProperty(value = "routingState", access = JsonProperty.Access.WRITE_ONLY) + private RoutingState routingState; + + /* + * List of references to Bgp Connections. + */ + @JsonProperty(value = "bgpConnections", access = JsonProperty.Access.WRITE_ONLY) + private List bgpConnections; + + /* + * List of references to IpConfigurations. + */ + @JsonProperty(value = "ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * List of references to RouteMaps. + */ + @JsonProperty(value = "routeMaps", access = JsonProperty.Access.WRITE_ONLY) + private List routeMaps; + + /* + * VirtualRouter ASN. + */ + @JsonProperty(value = "virtualRouterAsn") + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + @JsonProperty(value = "virtualRouterIps") + private List virtualRouterIps; + + /* + * Flag to control transit for VirtualRouter hub. + */ + @JsonProperty(value = "allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /* + * The preferred gateway to route on-prem traffic + */ + @JsonProperty(value = "preferredRoutingGateway") + private PreferredRoutingGateway preferredRoutingGateway; + + /* + * The hubRoutingPreference of this VirtualHub. + */ + @JsonProperty(value = "hubRoutingPreference") + private HubRoutingPreference hubRoutingPreference; + + /* + * The VirtualHub Router autoscale configuration. + */ + @JsonProperty(value = "virtualRouterAutoScaleConfiguration") + 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(); + } + } +} 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..8bedcca9111a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubRouteTableV2 Resource. */ +@Fluent +public final class VirtualHubRouteTableV2Inner extends SubResource { + /* + * Properties of the virtual hub route table v2. + */ + @JsonProperty(value = "properties") + private VirtualHubRouteTableV2Properties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..ef0b051402106 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Properties.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualHubRouteTableV2. */ +@Fluent +public final class VirtualHubRouteTableV2Properties { + /* + * List of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /* + * List of all connections attached to this route table v2. + */ + @JsonProperty(value = "attachedConnections") + private List attachedConnections; + + /* + * The provisioning state of the virtual hub route table v2 resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..6e12cb995f359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties", required = true) + private VirtualNetworkGatewayConnectionPropertiesFormatInner innerProperties = + new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkGatewayConnectionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayConnectionInner.class); +} 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..5e6d526044c25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties", required = true) + private VirtualNetworkGatewayConnectionListEntityPropertiesFormat innerProperties = + new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model" + + " VirtualNetworkGatewayConnectionListEntityInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayConnectionListEntityInner.class); +} 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..6cf7af99fb4ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayConnection properties. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListEntityPropertiesFormat { + /* + * The authorizationKey. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + @JsonProperty(value = "localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /* + * Gateway connection type. + */ + @JsonProperty(value = "connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + @JsonProperty(value = "routingWeight") + private Integer routingWeight; + + /* + * The connection mode for this connection. + */ + @JsonProperty(value = "connectionMode") + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + @JsonProperty(value = "peer") + private SubResource peer; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableBgp") + private Boolean enableBgp; + + /* + * GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + */ + @JsonProperty(value = "gatewayCustomBgpIpAddresses") + private List gatewayCustomBgpIpAddresses; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + @JsonProperty(value = "enablePrivateLinkFastPath") + 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 + .logExceptionAsError( + 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 + .logExceptionAsError( + 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); +} 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..e13a2b0d1a91e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java @@ -0,0 +1,726 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayConnection properties. */ +@Fluent +public final class VirtualNetworkGatewayConnectionPropertiesFormatInner { + /* + * The authorizationKey. + */ + @JsonProperty(value = "authorizationKey") + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + @JsonProperty(value = "localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /* + * List of ingress NatRules. + */ + @JsonProperty(value = "ingressNatRules") + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + @JsonProperty(value = "egressNatRules") + private List egressNatRules; + + /* + * Gateway connection type. + */ + @JsonProperty(value = "connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + @JsonProperty(value = "routingWeight") + private Integer routingWeight; + + /* + * The dead peer detection timeout of this connection in seconds. + */ + @JsonProperty(value = "dpdTimeoutSeconds") + private Integer dpdTimeoutSeconds; + + /* + * The connection mode for this connection. + */ + @JsonProperty(value = "connectionMode") + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + @JsonProperty(value = "peer") + private SubResource peer; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableBgp") + private Boolean enableBgp; + + /* + * GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + */ + @JsonProperty(value = "gatewayCustomBgpIpAddresses") + private List gatewayCustomBgpIpAddresses; + + /* + * Use private local Azure IP for the connection. + */ + @JsonProperty(value = "useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + @JsonProperty(value = "enablePrivateLinkFastPath") + 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 + .logExceptionAsError( + 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 + .logExceptionAsError( + 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); +} 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..8050cb5f4e34a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java @@ -0,0 +1,659 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.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 com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties", required = true) + private VirtualNetworkGatewayPropertiesFormat innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + + /* + * The extended location of type local virtual network gateway. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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 id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkGatewayInner")); + } else { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayInner.class); +} 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..e4c7bfb86fdbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of VirtualNetworkGatewayIPConfiguration. */ +@Fluent +public final class VirtualNetworkGatewayIpConfigurationPropertiesFormat { + /* + * The private IP address allocation method. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The reference to the public IP resource. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /* + * Private IP Address for this gateway. + */ + @JsonProperty(value = "privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The provisioning state of the virtual network gateway IP configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..54395cca89968 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayNatRule Resource. */ +@Fluent +public final class VirtualNetworkGatewayNatRuleInner extends SubResource { + /* + * Properties of the Virtual Network Gateway NAT rule. + */ + @JsonProperty(value = "properties") + private VirtualNetworkGatewayNatRuleProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..ecc8900073276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleProperties.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualNetworkGatewayNatRule. */ +@Fluent +public final class VirtualNetworkGatewayNatRuleProperties { + /* + * The provisioning state of the NAT Rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + @JsonProperty(value = "type") + private VpnNatRuleType type; + + /* + * The Source NAT direction of a VPN NAT. + */ + @JsonProperty(value = "mode") + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + @JsonProperty(value = "internalMappings") + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + @JsonProperty(value = "externalMappings") + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + @JsonProperty(value = "ipConfigurationId") + 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()); + } + } +} 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..b4b971980df30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPolicyGroupProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayPolicyGroupMember; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of VirtualNetworkGatewayPolicyGroup. */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroupProperties { + /* + * Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + */ + @JsonProperty(value = "isDefault", required = true) + private boolean isDefault; + + /* + * Priority for VirtualNetworkGatewayPolicyGroup. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + */ + @JsonProperty(value = "policyMembers", required = true) + private List policyMembers; + + /* + * List of references to vngClientConnectionConfigurations. + */ + @JsonProperty(value = "vngClientConnectionConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List vngClientConnectionConfigurations; + + /* + * The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policyMembers in model VirtualNetworkGatewayPolicyGroupProperties")); + } else { + policyMembers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayPolicyGroupProperties.class); +} 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..a611f6dc5e781 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.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.SubResource; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGateway properties. */ +@Fluent +public final class VirtualNetworkGatewayPropertiesFormat { + /* + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * The type of this virtual network gateway. + */ + @JsonProperty(value = "gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /* + * The type of this virtual network gateway. + */ + @JsonProperty(value = "vpnType") + private VpnType vpnType; + + /* + * The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + */ + @JsonProperty(value = "vpnGatewayGeneration") + private VpnGatewayGeneration vpnGatewayGeneration; + + /* + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "enableBgp") + private Boolean enableBgp; + + /* + * Whether private IP needs to be enabled on this gateway for connections or not. + */ + @JsonProperty(value = "enablePrivateIpAddress") + private Boolean enablePrivateIpAddress; + + /* + * ActiveActive flag. + */ + @JsonProperty(value = "activeActive") + private Boolean active; + + /* + * disableIPSecReplayProtection flag. + */ + @JsonProperty(value = "disableIPSecReplayProtection") + 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. + */ + @JsonProperty(value = "gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /* + * The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network + * gateway. + */ + @JsonProperty(value = "sku") + private VirtualNetworkGatewaySku sku; + + /* + * The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + */ + @JsonProperty(value = "vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /* + * The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available + * VirtualNetworkGatewayPolicyGroup for the gateway. + */ + @JsonProperty(value = "virtualNetworkGatewayPolicyGroups") + private List virtualNetworkGatewayPolicyGroups; + + /* + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "bgpSettings") + private BgpSettings bgpSettings; + + /* + * The reference to the address space resource which represents the custom routes address space specified by the + * customer for virtual network gateway and VpnClient. + */ + @JsonProperty(value = "customRoutes") + private AddressSpace customRoutes; + + /* + * The resource GUID property of the virtual network gateway resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Whether dns forwarding is enabled or not. + */ + @JsonProperty(value = "enableDnsForwarding") + private Boolean enableDnsForwarding; + + /* + * The IP address allocated by the gateway to which dns requests can be sent. + */ + @JsonProperty(value = "inboundDnsForwardingEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String inboundDnsForwardingEndpoint; + + /* + * Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. + */ + @JsonProperty(value = "vNetExtendedLocationResourceId") + private String vNetExtendedLocationResourceId; + + /* + * NatRules for virtual network gateway. + */ + @JsonProperty(value = "natRules") + private List natRules; + + /* + * EnableBgpRouteTranslationForNat flag. + */ + @JsonProperty(value = "enableBgpRouteTranslationForNat") + private Boolean enableBgpRouteTranslationForNat; + + /* + * Configures this gateway to accept traffic from remote Virtual WAN networks. + */ + @JsonProperty(value = "allowVirtualWanTraffic") + private Boolean allowVirtualWanTraffic; + + /* + * Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support + * connectivity to Azure Virtual WAN. + */ + @JsonProperty(value = "allowRemoteVnetTraffic") + private Boolean allowRemoteVnetTraffic; + + /** Creates an instance of VirtualNetworkGatewayPropertiesFormat class. */ + public VirtualNetworkGatewayPropertiesFormat() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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()); + } + } +} 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..b1157f49492cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Properties of the virtual network. + */ + @JsonProperty(value = "properties") + private VirtualNetworkPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + + /** + * 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(); + } + } +} 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..6645967025ed5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; + +/** Peerings in a virtual network resource. */ +@Fluent +public final class VirtualNetworkPeeringInner extends SubResource { + /* + * Properties of the virtual network peering. + */ + @JsonProperty(value = "properties") + private VirtualNetworkPeeringPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** 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 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..889252f769325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringPropertiesFormat.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the virtual network peering. */ +@Fluent +public final class VirtualNetworkPeeringPropertiesFormat { + /* + * Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network + * space. + */ + @JsonProperty(value = "allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /* + * Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote + * virtual network. + */ + @JsonProperty(value = "allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /* + * If gateway links can be used in remote virtual networking to link to this virtual network. + */ + @JsonProperty(value = "allowGatewayTransit") + private Boolean allowGatewayTransit; + + /* + * If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on + * remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one + * peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + */ + @JsonProperty(value = "useRemoteGateways") + private Boolean useRemoteGateways; + + /* + * The reference to the remote virtual network. The remote virtual network can be in the same or different region + * (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /* + * The reference to the address space peered with the remote virtual network. + */ + @JsonProperty(value = "remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /* + * The reference to the current address space of the remote virtual network. + */ + @JsonProperty(value = "remoteVirtualNetworkAddressSpace") + private AddressSpace remoteVirtualNetworkAddressSpace; + + /* + * The reference to the remote virtual network's Bgp Communities. + */ + @JsonProperty(value = "remoteBgpCommunities") + private VirtualNetworkBgpCommunities remoteBgpCommunities; + + /* + * The reference to the remote virtual network's encryption + */ + @JsonProperty(value = "remoteVirtualNetworkEncryption", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkEncryption remoteVirtualNetworkEncryption; + + /* + * The status of the virtual network peering. + */ + @JsonProperty(value = "peeringState") + private VirtualNetworkPeeringState peeringState; + + /* + * The peering sync status of the virtual network peering. + */ + @JsonProperty(value = "peeringSyncLevel") + private VirtualNetworkPeeringLevel peeringSyncLevel; + + /* + * The provisioning state of the virtual network peering resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * If we need to verify the provisioning state of the remote gateway. + */ + @JsonProperty(value = "doNotVerifyRemoteGateways") + private Boolean doNotVerifyRemoteGateways; + + /* + * The resourceGuid property of the Virtual Network peering resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (remoteAddressSpace() != null) { + remoteAddressSpace().validate(); + } + if (remoteVirtualNetworkAddressSpace() != null) { + remoteVirtualNetworkAddressSpace().validate(); + } + if (remoteBgpCommunities() != null) { + remoteBgpCommunities().validate(); + } + if (remoteVirtualNetworkEncryption() != null) { + remoteVirtualNetworkEncryption().validate(); + } + } +} 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..666539a205d1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.java @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the virtual network. */ +@Fluent +public final class VirtualNetworkPropertiesFormat { + /* + * The AddressSpace that contains an array of IP address ranges that can be used by subnets. + */ + @JsonProperty(value = "addressSpace") + private AddressSpace addressSpace; + + /* + * The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + */ + @JsonProperty(value = "dhcpOptions") + private DhcpOptions dhcpOptions; + + /* + * The FlowTimeout value (in minutes) for the Virtual Network + */ + @JsonProperty(value = "flowTimeoutInMinutes") + private Integer flowTimeoutInMinutes; + + /* + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "subnets") + private List subnets; + + /* + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /* + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a + * DDoS protection plan associated with the resource. + */ + @JsonProperty(value = "enableDdosProtection") + private Boolean enableDdosProtection; + + /* + * Indicates if VM protection is enabled for all the subnets in the virtual network. + */ + @JsonProperty(value = "enableVmProtection") + private Boolean enableVmProtection; + + /* + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /* + * Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + */ + @JsonProperty(value = "bgpCommunities") + private VirtualNetworkBgpCommunities bgpCommunities; + + /* + * Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. + */ + @JsonProperty(value = "encryption") + private VirtualNetworkEncryption encryption; + + /* + * Array of IpAllocation which reference this VNET. + */ + @JsonProperty(value = "ipAllocations") + private List ipAllocations; + + /* + * A collection of references to flow log resources. + */ + @JsonProperty(value = "flowLogs", access = JsonProperty.Access.WRITE_ONLY) + private List flowLogs; + + /** 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; + } + + /** + * 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()); + } + } +} 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..58ac831bf6bcd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Virtual Network Tap resource. */ +@Fluent +public final class VirtualNetworkTapInner extends Resource { + /* + * Virtual Network Tap Properties. + */ + @JsonProperty(value = "properties") + private VirtualNetworkTapPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..bb7edfeff7ec3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapPropertiesFormatInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Virtual Network Tap properties. */ +@Fluent +public final class VirtualNetworkTapPropertiesFormatInner { + /* + * Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. + */ + @JsonProperty(value = "networkInterfaceTapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaceTapConfigurations; + + /* + * The resource GUID property of the virtual network tap resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The provisioning state of the virtual network tap resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The reference to the private IP Address of the collector nic that will receive the tap. + */ + @JsonProperty(value = "destinationNetworkInterfaceIPConfiguration") + private NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration; + + /* + * The reference to the private IP address on the internal Load Balancer that will receive the tap. + */ + @JsonProperty(value = "destinationLoadBalancerFrontEndIPConfiguration") + private FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration; + + /* + * The VXLAN destination port that will receive the tapped traffic. + */ + @JsonProperty(value = "destinationPort") + 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(); + } + } +} 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..51ab7fc3b6ff9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Usage details for subnet. */ +@Immutable +public final class VirtualNetworkUsageInner { + /* + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /* + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /* + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /* + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** 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(); + } + } +} 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..783f8a7354bd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualRouter Resource. */ +@Fluent +public final class VirtualRouterInner extends Resource { + /* + * Properties of the Virtual Router. + */ + @JsonProperty(value = "properties") + private VirtualRouterPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..970a4b30642e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Router Peering resource. */ +@Fluent +public final class VirtualRouterPeeringInner extends SubResource { + /* + * The properties of the Virtual Router Peering. + */ + @JsonProperty(value = "properties") + private VirtualRouterPeeringProperties innerProperties; + + /* + * Name of the virtual router peering that is unique within a virtual router. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Peering type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..61b5d007a1329 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the rule group. */ +@Fluent +public final class VirtualRouterPeeringProperties { + /* + * Peer ASN. + */ + @JsonProperty(value = "peerAsn") + private Long peerAsn; + + /* + * Peer IP. + */ + @JsonProperty(value = "peerIp") + private String peerIp; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..129b0127b5d84 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPropertiesFormat.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Virtual Router definition. */ +@Fluent +public final class VirtualRouterPropertiesFormat { + /* + * VirtualRouter ASN. + */ + @JsonProperty(value = "virtualRouterAsn") + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + @JsonProperty(value = "virtualRouterIps") + private List virtualRouterIps; + + /* + * The Subnet on which VirtualRouter is hosted. + */ + @JsonProperty(value = "hostedSubnet") + private SubResource hostedSubnet; + + /* + * The Gateway on which VirtualRouter is hosted. + */ + @JsonProperty(value = "hostedGateway") + private SubResource hostedGateway; + + /* + * List of references to VirtualRouterPeerings. + */ + @JsonProperty(value = "peerings", access = JsonProperty.Access.WRITE_ONLY) + private List peerings; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..24fc10adf044b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualWAN Resource. */ +@Fluent +public final class VirtualWanInner extends Resource { + /* + * Properties of the virtual WAN. + */ + @JsonProperty(value = "properties") + private VirtualWanProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..3bd4e425f8c3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualWAN. */ +@Fluent +public final class VirtualWanProperties { + /* + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "disableVpnEncryption") + private Boolean disableVpnEncryption; + + /* + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /* + * List of VpnSites in the VirtualWAN. + */ + @JsonProperty(value = "vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /* + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /* + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /* + * The office local breakout category. + */ + @JsonProperty(value = "office365LocalBreakoutCategory", access = JsonProperty.Access.WRITE_ONLY) + private OfficeTrafficCategory office365LocalBreakoutCategory; + + /* + * The provisioning state of the virtual WAN resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of the VirtualWAN. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..2b88d366399ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvidersInner { + /* + * List of VirtualWAN security providers. + */ + @JsonProperty(value = "supportedProviders") + 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()); + } + } +} 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..16e2f678ad3d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VngClientConnectionConfigurationProperties.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of VngClientConnectionConfiguration. */ +@Fluent +public final class VngClientConnectionConfigurationProperties { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool", required = true) + private AddressSpace vpnClientAddressPool; + + /* + * List of references to virtualNetworkGatewayPolicyGroups + */ + @JsonProperty(value = "virtualNetworkGatewayPolicyGroups", required = true) + private List virtualNetworkGatewayPolicyGroups; + + /* + * The provisioning state of the VngClientConnectionConfiguration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vpnClientAddressPool in model" + + " VngClientConnectionConfigurationProperties")); + } else { + vpnClientAddressPool().validate(); + } + if (virtualNetworkGatewayPolicyGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkGatewayPolicyGroups in model" + + " VngClientConnectionConfigurationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VngClientConnectionConfigurationProperties.class); +} 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..83dde4894ff17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway vpn client connection health. */ +@Fluent +public final class VpnClientConnectionHealthDetailListResultInner { + /* + * List of vpn client connection health. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..656bce53b1902 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IPSec parameters for a virtual network gateway P2S connection. */ +@Fluent +public final class VpnClientIPsecParametersInner { + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecEncryption in model VpnClientIPsecParametersInner")); + } + if (ipsecIntegrity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecIntegrity in model VpnClientIPsecParametersInner")); + } + if (ikeEncryption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeEncryption in model VpnClientIPsecParametersInner")); + } + if (ikeIntegrity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeIntegrity in model VpnClientIPsecParametersInner")); + } + if (dhGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dhGroup in model VpnClientIPsecParametersInner")); + } + if (pfsGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pfsGroup in model VpnClientIPsecParametersInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientIPsecParametersInner.class); +} 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..00dc199685606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRevokedCertificatePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the revoked VPN client certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRevokedCertificatePropertiesFormat { + /* + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * The provisioning state of the VPN client revoked certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..6ce3405bea859 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of SSL certificates of application gateway. */ +@Fluent +public final class VpnClientRootCertificatePropertiesFormat { + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData", required = true) + private String publicCertData; + + /* + * The provisioning state of the VPN client root certificate resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicCertData in model VpnClientRootCertificatePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientRootCertificatePropertiesFormat.class); +} 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..a4ac849c9f26a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnConnection Resource. */ +@Fluent +public final class VpnConnectionInner extends SubResource { + /* + * Properties of the VPN connection. + */ + @JsonProperty(value = "properties") + private VpnConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..e488360cbdfcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionProperties.java @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnConnection. */ +@Fluent +public final class VpnConnectionProperties { + /* + * Id of the connected vpn site. + */ + @JsonProperty(value = "remoteVpnSite") + private SubResource remoteVpnSite; + + /* + * Routing weight for vpn connection. + */ + @JsonProperty(value = "routingWeight") + private Integer routingWeight; + + /* + * DPD timeout in seconds for vpn connection. + */ + @JsonProperty(value = "dpdTimeoutSeconds") + private Integer dpdTimeoutSeconds; + + /* + * The connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "connectionBandwidth") + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableBgp") + private Boolean enableBgp; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "ipsecPolicies") + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + @JsonProperty(value = "trafficSelectorPolicies") + private List trafficSelectorPolicies; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableRateLimiting") + private Boolean enableRateLimiting; + + /* + * Enable internet security. + */ + @JsonProperty(value = "enableInternetSecurity") + private Boolean enableInternetSecurity; + + /* + * Use local azure ip to initiate connection. + */ + @JsonProperty(value = "useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of all vpn site link connections to the gateway. + */ + @JsonProperty(value = "vpnLinkConnections") + private List vpnLinkConnections; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + @JsonProperty(value = "routingConfiguration") + 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(); + } + } +} 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..6c7923a3f4cb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnGateway Resource. */ +@Fluent +public final class VpnGatewayInner extends Resource { + /* + * Properties of the VPN gateway. + */ + @JsonProperty(value = "properties") + private VpnGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..b891551d582be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnGatewayNatRule Resource. */ +@Fluent +public final class VpnGatewayNatRuleInner extends SubResource { + /* + * Properties of the VpnGateway NAT rule. + */ + @JsonProperty(value = "properties") + private VpnGatewayNatRuleProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..7907b525cf2ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleProperties.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnGatewayNatRule. */ +@Fluent +public final class VpnGatewayNatRuleProperties { + /* + * The provisioning state of the NAT Rule resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + @JsonProperty(value = "type") + private VpnNatRuleType type; + + /* + * The Source NAT direction of a VPN NAT. + */ + @JsonProperty(value = "mode") + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + @JsonProperty(value = "internalMappings") + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + @JsonProperty(value = "externalMappings") + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + @JsonProperty(value = "ipConfigurationId") + private String ipConfigurationId; + + /* + * List of egress VpnSiteLinkConnections. + */ + @JsonProperty(value = "egressVpnSiteLinkConnections", access = JsonProperty.Access.WRITE_ONLY) + private List egressVpnSiteLinkConnections; + + /* + * List of ingress VpnSiteLinkConnections. + */ + @JsonProperty(value = "ingressVpnSiteLinkConnections", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..791336d44748f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.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.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnGateway. */ +@Fluent +public final class VpnGatewayProperties { + /* + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "virtualHub") + private SubResource virtualHub; + + /* + * List of all vpn connections to the gateway. + */ + @JsonProperty(value = "connections") + private List connections; + + /* + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "bgpSettings") + private BgpSettings bgpSettings; + + /* + * The provisioning state of the VPN gateway resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The scale unit for this vpn gateway. + */ + @JsonProperty(value = "vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /* + * List of all IPs configured on the gateway. + */ + @JsonProperty(value = "ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /* + * Enable BGP routes translation for NAT on this VpnGateway. + */ + @JsonProperty(value = "enableBgpRouteTranslationForNat") + private Boolean enableBgpRouteTranslationForNat; + + /* + * Enable Routing Preference property for the Public IP Interface of the VpnGateway. + */ + @JsonProperty(value = "isRoutingPreferenceInternet") + private Boolean isRoutingPreferenceInternet; + + /* + * List of all the nat Rules associated with the gateway. + */ + @JsonProperty(value = "natRules") + 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()); + } + } +} 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..e43bb456f65ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn Profile Response for package generation. */ +@Fluent +public final class VpnProfileResponseInner { + /* + * URL to the VPN profile. + */ + @JsonProperty(value = "profileUrl") + 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() { + } +} 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..09bdd9e40a639 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.resourcemanager.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnServerConfiguration Resource. */ +@Fluent +public final class VpnServerConfigurationInner extends Resource { + /* + * Properties of the P2SVpnServer configuration. + */ + @JsonProperty(value = "properties") + private VpnServerConfigurationProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..b2ce975dc5e7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupInner.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnServerConfigurationPolicyGroup Resource. */ +@Fluent +public final class VpnServerConfigurationPolicyGroupInner extends SubResource { + /* + * Properties of the VpnServerConfigurationPolicyGroup. + */ + @JsonProperty(value = "properties") + private VpnServerConfigurationPolicyGroupProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..15f371225cd4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupProperties.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnServerConfigurationPolicyGroup. */ +@Fluent +public final class VpnServerConfigurationPolicyGroupProperties { + /* + * Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /* + * Priority for VpnServerConfigurationPolicyGroup. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + */ + @JsonProperty(value = "policyMembers") + private List policyMembers; + + /* + * List of references to P2SConnectionConfigurations. + */ + @JsonProperty(value = "p2SConnectionConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List p2SConnectionConfigurations; + + /* + * The provisioning state of the VpnServerConfigurationPolicyGroup resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..a345f8a18fc0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigurationProperties { + /* + * The name of the VpnServerConfiguration that is unique within a resource group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * VPN protocols for the VpnServerConfiguration. + */ + @JsonProperty(value = "vpnProtocols") + private List vpnProtocols; + + /* + * VPN authentication types for the VpnServerConfiguration. + */ + @JsonProperty(value = "vpnAuthenticationTypes") + private List vpnAuthenticationTypes; + + /* + * VPN client root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /* + * VPN client revoked certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /* + * Radius Server root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "radiusServerRootCertificates") + private List radiusServerRootCertificates; + + /* + * Radius client root certificate of VpnServerConfiguration. + */ + @JsonProperty(value = "radiusClientRootCertificates") + private List radiusClientRootCertificates; + + /* + * VpnClientIpsecPolicies for VpnServerConfiguration. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VpnServerConfiguration resource for point to site client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /* + * The radius secret property of the VpnServerConfiguration resource for point to site client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /* + * Multiple Radius Server configuration for VpnServerConfiguration. + */ + @JsonProperty(value = "radiusServers") + private List radiusServers; + + /* + * The set of aad vpn authentication parameters. + */ + @JsonProperty(value = "aadAuthenticationParameters") + private AadAuthenticationParameters aadAuthenticationParameters; + + /* + * The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * List of references to P2SVpnGateways. + */ + @JsonProperty(value = "p2SVpnGateways", access = JsonProperty.Access.WRITE_ONLY) + private List p2SVpnGateways; + + /* + * List of all VpnServerConfigurationPolicyGroups. + */ + @JsonProperty(value = "configurationPolicyGroups") + private List configurationPolicyGroups; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..bd8099fd952fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnServerConfigurations list associated with VirtualWan Response. */ +@Fluent +public final class VpnServerConfigurationsResponseInner { + /* + * List of VpnServerConfigurations associated with VirtualWan. + */ + @JsonProperty(value = "vpnServerConfigurationResourceIds") + 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() { + } +} 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..83c0209dc650c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.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.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnSite Resource. */ +@Fluent +public final class VpnSiteInner extends Resource { + /* + * Properties of the VPN site. + */ + @JsonProperty(value = "properties") + private VpnSiteProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..06d3829a7a20b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnSiteLinkConnection Resource. */ +@Fluent +public final class VpnSiteLinkConnectionInner extends SubResource { + /* + * Properties of the VPN site link connection. + */ + @JsonProperty(value = "properties") + private VpnSiteLinkConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..d6f20b52eeaec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionProperties.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnConnection. */ +@Fluent +public final class VpnSiteLinkConnectionProperties { + /* + * Id of the connected vpn site link. + */ + @JsonProperty(value = "vpnSiteLink") + private SubResource vpnSiteLink; + + /* + * Routing weight for vpn connection. + */ + @JsonProperty(value = "routingWeight") + private Integer routingWeight; + + /* + * Vpn link connection mode. + */ + @JsonProperty(value = "vpnLinkConnectionMode") + private VpnLinkConnectionMode vpnLinkConnectionMode; + + /* + * The connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + @JsonProperty(value = "vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "connectionBandwidth") + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableBgp") + private Boolean enableBgp; + + /* + * vpnGatewayCustomBgpAddresses used by this connection. + */ + @JsonProperty(value = "vpnGatewayCustomBgpAddresses") + private List vpnGatewayCustomBgpAddresses; + + /* + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "ipsecPolicies") + private List ipsecPolicies; + + /* + * EnableBgp flag. + */ + @JsonProperty(value = "enableRateLimiting") + private Boolean enableRateLimiting; + + /* + * Use local azure ip to initiate connection. + */ + @JsonProperty(value = "useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN site link connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of ingress NatRules. + */ + @JsonProperty(value = "ingressNatRules") + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + @JsonProperty(value = "egressNatRules") + private List egressNatRules; + + /** 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; + } + + /** + * 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()); + } + } +} 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..8be5db91e4d5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.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.SubResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VpnSiteLink Resource. */ +@Fluent +public final class VpnSiteLinkInner extends SubResource { + /* + * Properties of the VPN site link. + */ + @JsonProperty(value = "properties") + private VpnSiteLinkProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..68e5674b2733d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkProperties.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.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for VpnSite. */ +@Fluent +public final class VpnSiteLinkProperties { + /* + * The link provider properties. + */ + @JsonProperty(value = "linkProperties") + private VpnLinkProviderProperties linkProperties; + + /* + * The ip-address for the vpn-site-link. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * FQDN of vpn-site-link. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The set of bgp properties. + */ + @JsonProperty(value = "bgpProperties") + private VpnLinkBgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site link resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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..2f11f61c42ec2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteProperties.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.SubResource; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnSite. */ +@Fluent +public final class VpnSiteProperties { + /* + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "virtualWan") + private SubResource virtualWan; + + /* + * The device properties. + */ + @JsonProperty(value = "deviceProperties") + private DeviceProperties deviceProperties; + + /* + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "siteKey") + private String siteKey; + + /* + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "addressSpace") + private AddressSpace addressSpace; + + /* + * The set of bgp properties. + */ + @JsonProperty(value = "bgpProperties") + private BgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * IsSecuritySite flag. + */ + @JsonProperty(value = "isSecuritySite") + private Boolean isSecuritySite; + + /* + * List of all vpn site links. + */ + @JsonProperty(value = "vpnSiteLinks") + private List vpnSiteLinks; + + /* + * Office365 Policy. + */ + @JsonProperty(value = "o365Policy") + 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(); + } + } +} 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..b032c2617bf20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private WebApplicationFirewallPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..9a9d1770f02e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyPropertiesFormat.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines web application firewall policy properties. */ +@Fluent +public final class WebApplicationFirewallPolicyPropertiesFormat { + /* + * The PolicySettings for policy. + */ + @JsonProperty(value = "policySettings") + private PolicySettings policySettings; + + /* + * The custom rules inside the policy. + */ + @JsonProperty(value = "customRules") + private List customRules; + + /* + * A collection of references to application gateways. + */ + @JsonProperty(value = "applicationGateways", access = JsonProperty.Access.WRITE_ONLY) + private List applicationGateways; + + /* + * The provisioning state of the web application firewall policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private WebApplicationFirewallPolicyResourceState resourceState; + + /* + * Describes the managedRules structure. + */ + @JsonProperty(value = "managedRules", required = true) + private ManagedRulesDefinition managedRules; + + /* + * A collection of references to application gateway http listeners. + */ + @JsonProperty(value = "httpListeners", access = JsonProperty.Access.WRITE_ONLY) + private List httpListeners; + + /* + * A collection of references to application gateway path rules. + */ + @JsonProperty(value = "pathBasedRules", access = JsonProperty.Access.WRITE_ONLY) + private List pathBasedRules; + + /** 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; + } + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedRules in model" + + " WebApplicationFirewallPolicyPropertiesFormat")); + } else { + managedRules().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallPolicyPropertiesFormat.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..00c2078cc0bd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java new file mode 100644 index 0000000000000..441007dd96a3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..9e63114d5449a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveConnectivityConfigurationsListResultImpl.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.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..03871684ded6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveSecurityAdminRulesListResultImpl.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.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..42a7f40e07251 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "securityAdminConfigurations"); + this.ruleCollectionName = Utils.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..269cd7bc4750e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsClientImpl.java @@ -0,0 +1,1316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ce1b45f6e89b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsImpl.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.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 Utils.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 Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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..1a06e5d75ee8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesClientImpl.java @@ -0,0 +1,1462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ba3cbd71ee0f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.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 Utils.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..e6e797ff2285f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslOptions; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationGatewayAvailableSslOptionsImpl implements ApplicationGatewayAvailableSslOptions { + private ApplicationGatewayAvailableSslOptionsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayAvailableSslOptionsImpl( + ApplicationGatewayAvailableSslOptionsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public 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..7ccfa21572cee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableWafRuleSetsResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayAvailableWafRuleSetsResultImpl + implements ApplicationGatewayAvailableWafRuleSetsResult { + private ApplicationGatewayAvailableWafRuleSetsResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayAvailableWafRuleSetsResultImpl( + ApplicationGatewayAvailableWafRuleSetsResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayAvailableWafRuleSetsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 0000000000000..e4779cdefe8e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayBackendHealthImpl implements ApplicationGatewayBackendHealth { + private ApplicationGatewayBackendHealthInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthImpl( + ApplicationGatewayBackendHealthInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List backendAddressPools() { + List inner = this.innerModel().backendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayBackendHealthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java new file mode 100644 index 0000000000000..c06d88bf7a63c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; + +public final class ApplicationGatewayBackendHealthOnDemandImpl implements ApplicationGatewayBackendHealthOnDemand { + private ApplicationGatewayBackendHealthOnDemandInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthOnDemandImpl( + ApplicationGatewayBackendHealthOnDemandInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.innerModel().backendHealthHttpSettings(); + } + + public ApplicationGatewayBackendHealthOnDemandInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java new file mode 100644 index 0000000000000..14d7cb4b0411b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServer; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; + +public final class ApplicationGatewayBackendHealthServerImpl implements ApplicationGatewayBackendHealthServer { + private ApplicationGatewayBackendHealthServerInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayBackendHealthServerImpl( + ApplicationGatewayBackendHealthServerInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String address() { + return this.innerModel().address(); + } + + public NetworkInterfaceIpConfiguration ipConfiguration() { + NetworkInterfaceIpConfigurationInner inner = this.innerModel().ipConfiguration(); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthServerHealth health() { + return this.innerModel().health(); + } + + public String healthProbeLog() { + return this.innerModel().healthProbeLog(); + } + + public ApplicationGatewayBackendHealthServerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java new file mode 100644 index 0000000000000..0e0c5b0db06bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,712 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGatewayName = Utils.getValueFromIdByName(innerObject.id(), "applicationGateways"); + } + + public ApplicationGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName); + } + + public void start(Context context) { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop() { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(Context context) { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth() { + 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..ba93047e686c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ApplicationGatewayPrivateEndpointConnectionImpl + implements ApplicationGatewayPrivateEndpointConnection { + private ApplicationGatewayPrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateEndpointConnectionImpl( + ApplicationGatewayPrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkIdentifier() { + return this.innerModel().linkIdentifier(); + } + + public ApplicationGatewayPrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..2a4a48f6f6805 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, parameters); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayPrivateEndpointConnectionInner.class, + ApplicationGatewayPrivateEndpointConnectionInner.class, + 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< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdateAsync( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayPrivateEndpointConnectionInner.class, + ApplicationGatewayPrivateEndpointConnectionInner.class, + context); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + 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< + PollResult, + 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..dbfac81d31cd6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.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.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 Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..e1c4e71149df5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayPrivateLinkResourceImpl implements ApplicationGatewayPrivateLinkResource { + private ApplicationGatewayPrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateLinkResourceImpl( + ApplicationGatewayPrivateLinkResourceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayPrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..9f16c61a331bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..6ec7ac3943ab5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.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 Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..a68017909ed0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPredefinedPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaySslPredefinedPolicyImpl implements ApplicationGatewaySslPredefinedPolicy { + private ApplicationGatewaySslPredefinedPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewaySslPredefinedPolicyImpl( + ApplicationGatewaySslPredefinedPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public List cipherSuites() { + List inner = this.innerModel().cipherSuites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.innerModel().minProtocolVersion(); + } + + public ApplicationGatewaySslPredefinedPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..ef19d51430d3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestResultImpl.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.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..436a825728ea3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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..72e15fd043116 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsClientImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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..02115c16228dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsImpl.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.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..5a2204bda6f19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsImpl.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.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 Utils + .mapPage(inner, inner1 -> new ApplicationGatewayWafDynamicManifestResultImpl(inner1, this.manager())); + } + + public PagedIterable get(String location, Context context) { + PagedIterable inner = + this.serviceClient().get(location, context); + return Utils + .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..054055b7f1cbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java @@ -0,0 +1,3711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + Mono>> mono = + backendHealthOnDemandWithResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthOnDemandInner.class, + ApplicationGatewayBackendHealthOnDemandInner.class, + 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< + PollResult, 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< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemandAsync( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + backendHealthOnDemandWithResponseAsync( + resourceGroupName, applicationGatewayName, probeRequest, expand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationGatewayBackendHealthOnDemandInner.class, + ApplicationGatewayBackendHealthOnDemandInner.class, + context); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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< + PollResult, 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< + PollResult, 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call 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..e0579587013fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.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.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 Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().start(resourceGroupName, applicationGatewayName); + } + + public void start(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth(String resourceGroupName, String applicationGatewayName) { + 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 Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSslPredefinedPolicies(Context context) { + PagedIterable inner = + this.serviceClient().listAvailableSslPredefinedPolicies(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, context); + } + + private ApplicationGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationGatewayImpl define(String name) { + return new ApplicationGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..967d69f0116f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "applicationSecurityGroups"); + } + + public ApplicationSecurityGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationSecurityGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context) + .getValue(); + return this; + } + + public ApplicationSecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationSecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationSecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java new file mode 100644 index 0000000000000..a15f6f9899caf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java @@ -0,0 +1,1503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of 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..9740f684e578a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.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.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 Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public ApplicationSecurityGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, context); + } + + private ApplicationSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationSecurityGroupImpl define(String name) { + return new ApplicationSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..fc9826a6caa60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkService; + +public final class AutoApprovedPrivateLinkServiceImpl implements AutoApprovedPrivateLinkService { + private AutoApprovedPrivateLinkServiceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AutoApprovedPrivateLinkServiceImpl( + AutoApprovedPrivateLinkServiceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String privateLinkService() { + return this.innerModel().privateLinkService(); + } + + public AutoApprovedPrivateLinkServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java new file mode 100644 index 0000000000000..7f88baceebc23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import java.util.Collections; +import java.util.List; + +public final class AvailableDelegationImpl implements AvailableDelegation { + private AvailableDelegationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableDelegationImpl( + AvailableDelegationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String serviceName() { + return this.innerModel().serviceName(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableDelegationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java new file mode 100644 index 0000000000000..64ab55aab01ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..cff3aa5f707a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.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.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 Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java new file mode 100644 index 0000000000000..e7999e44b2a5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..7f3c5d5531b6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.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.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 Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + private AvailableEndpointServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java new file mode 100644 index 0000000000000..7da37af37bcf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointType; + +public final class AvailablePrivateEndpointTypeImpl implements AvailablePrivateEndpointType { + private AvailablePrivateEndpointTypeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailablePrivateEndpointTypeImpl( + AvailablePrivateEndpointTypeInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public AvailablePrivateEndpointTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java new file mode 100644 index 0000000000000..e5361c0c7e7eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..75b05ce05c981 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.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.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 Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + private AvailablePrivateEndpointTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..bb3134655e7e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import java.util.Collections; +import java.util.List; + +public final class AvailableProvidersListImpl implements AvailableProvidersList { + private AvailableProvidersListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableProvidersListImpl( + AvailableProvidersListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List countries() { + List inner = this.innerModel().countries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableProvidersListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java new file mode 100644 index 0000000000000..7ce30469401bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..f8ed4ae3311f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.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.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 Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableResourceGroupDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java new file mode 100644 index 0000000000000..914b36b5a4eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAlias; + +public final class AvailableServiceAliasImpl implements AvailableServiceAlias { + private AvailableServiceAliasInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableServiceAliasImpl( + AvailableServiceAliasInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public AvailableServiceAliasInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java new file mode 100644 index 0000000000000..0b8c9d44a178a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java @@ -0,0 +1,606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..000074f66f011 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.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.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 Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + private AvailableServiceAliasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java new file mode 100644 index 0000000000000..3e255e4e9180b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTag; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class AzureFirewallFqdnTagImpl implements AzureFirewallFqdnTag { + private AzureFirewallFqdnTagInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureFirewallFqdnTagImpl( + AzureFirewallFqdnTagInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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..34a82df9cd0c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewallFqdnTags API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewallFqdnTags API service call 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..ec11e4dd46627 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.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.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 Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + private AzureFirewallFqdnTagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..d7b1bfcb46272 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.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.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureFirewallName = Utils.getValueFromIdByName(innerObject.id(), "azureFirewalls"); + } + + public AzureFirewall refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE) + .getValue(); + return this; + } + + public AzureFirewall refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context) + .getValue(); + return this; + } + + public IpPrefixesList listLearnedPrefixes() { + return serviceManager.azureFirewalls().listLearnedPrefixes(resourceGroupName, azureFirewallName); + } + + public IpPrefixesList listLearnedPrefixes(Context context) { + return serviceManager.azureFirewalls().listLearnedPrefixes(resourceGroupName, azureFirewallName, 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; + } + + 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..fdb2810d6e1e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java @@ -0,0 +1,1813 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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"}) + @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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call 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..3f5a578843936 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.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.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.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 Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public 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 AzureFirewall getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, context); + } + + private AzureFirewallsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public AzureFirewallImpl define(String name) { + return new AzureFirewallImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..9253fb87414fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import java.util.Collections; +import java.util.List; + +public final class AzureReachabilityReportImpl implements AzureReachabilityReport { + private AzureReachabilityReportInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureReachabilityReportImpl( + AzureReachabilityReportInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aggregationLevel() { + return this.innerModel().aggregationLevel(); + } + + public AzureReachabilityReportLocation providerLocation() { + return this.innerModel().providerLocation(); + } + + public List reachabilityReport() { + List inner = this.innerModel().reachabilityReport(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureReachabilityReportInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java new file mode 100644 index 0000000000000..46048ae25edd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategory; + +public final class AzureWebCategoryImpl implements AzureWebCategory { + private AzureWebCategoryInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureWebCategoryImpl( + AzureWebCategoryInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String group() { + return this.innerModel().group(); + } + + public AzureWebCategoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..6d4cc27eb17eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressInboundNatRulePortMappingsImpl.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.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..0939c68fd167f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class BackendAddressPoolImpl + implements BackendAddressPool, BackendAddressPool.Definition, BackendAddressPool.Update { + private BackendAddressPoolInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public List tunnelInterfaces() { + List inner = this.innerModel().tunnelInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerBackendAddresses() { + List inner = this.innerModel().loadBalancerBackendAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backendIpConfigurations() { + List inner = this.innerModel().backendIpConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource outboundRule() { + return this.innerModel().outboundRule(); + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.backendAddressPoolName = Utils.getValueFromIdByName(innerObject.id(), "backendAddressPools"); + } + + public BackendAddressPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE) + .getValue(); + return this; + } + + public BackendAddressPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context) + .getValue(); + return this; + } + + public BackendAddressPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BackendAddressPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BackendAddressPoolImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public BackendAddressPoolImpl withTunnelInterfaces(List tunnelInterfaces) { + this.innerModel().withTunnelInterfaces(tunnelInterfaces); + return this; + } + + public BackendAddressPoolImpl withLoadBalancerBackendAddresses( + List loadBalancerBackendAddresses) { + this.innerModel().withLoadBalancerBackendAddresses(loadBalancerBackendAddresses); + return this; + } + + public BackendAddressPoolImpl withDrainPeriodInSeconds(Integer drainPeriodInSeconds) { + this.innerModel().withDrainPeriodInSeconds(drainPeriodInSeconds); + return this; + } + + public BackendAddressPoolImpl withVirtualNetwork(SubResource virtualNetwork) { + this.innerModel().withVirtualNetwork(virtualNetwork); + 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..8d1283f4407c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BaseAdminRuleImpl.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +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 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..3f2c6a2e09817 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSession; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; + +public final class BastionActiveSessionImpl implements BastionActiveSession { + private BastionActiveSessionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionActiveSessionImpl( + BastionActiveSessionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public Object startTime() { + return this.innerModel().startTime(); + } + + public String targetSubscriptionId() { + return this.innerModel().targetSubscriptionId(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String targetHostname() { + return this.innerModel().targetHostname(); + } + + public String targetResourceGroup() { + return this.innerModel().targetResourceGroup(); + } + + public String username() { + return this.innerModel().username(); + } + + public String targetIpAddress() { + return this.innerModel().targetIpAddress(); + } + + public BastionConnectProtocol protocol() { + return this.innerModel().protocol(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public Float sessionDurationInMins() { + return this.innerModel().sessionDurationInMins(); + } + + public BastionActiveSessionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java new file mode 100644 index 0000000000000..816f00b8ecb7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHost; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import 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 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 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.bastionHostname = Utils.getValueFromIdByName(innerObject.id(), "bastionHosts"); + } + + public BastionHost refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getByResourceGroupWithResponse(resourceGroupName, bastionHostname, Context.NONE) + .getValue(); + return this; + } + + public BastionHost refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context) + .getValue(); + return this; + } + + public BastionHostImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BastionHostImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BastionHostImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public BastionHostImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public BastionHostImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public BastionHostImpl withDnsName(String dnsName) { + this.innerModel().withDnsName(dnsName); + return this; + } + + 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; + } + + 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..53e9624ebc637 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java @@ -0,0 +1,1549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b72ca21b8d0e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.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.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 Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public BastionHost getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, context); + } + + private BastionHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BastionHostImpl define(String name) { + return new BastionHostImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java new file mode 100644 index 0000000000000..784524a4495b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.models.BastionSessionState; + +public final class BastionSessionStateImpl implements BastionSessionState { + private BastionSessionStateInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionSessionStateImpl( + BastionSessionStateInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public String message() { + return this.innerModel().message(); + } + + public String state() { + return this.innerModel().state(); + } + + public BastionSessionStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java new file mode 100644 index 0000000000000..c0e64bac5cc18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLink; +import com.azure.resourcemanager.network.generated.models.VM; + +public final class BastionShareableLinkImpl implements BastionShareableLink { + private BastionShareableLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionShareableLinkImpl( + BastionShareableLinkInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VM vm() { + return this.innerModel().vm(); + } + + public String bsl() { + return this.innerModel().bsl(); + } + + public String createdAt() { + return this.innerModel().createdAt(); + } + + public String message() { + return this.innerModel().message(); + } + + public BastionShareableLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java new file mode 100644 index 0000000000000..21a56a70ef68a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "bgpConnections"); + } + + public BgpConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public BgpConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubBgpConnections() + .getWithResponse(resourceGroupName, virtualHubName, connectionName, context) + .getValue(); + return this; + } + + public BgpConnectionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public BgpConnectionImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public BgpConnectionImpl withPeerIp(String peerIp) { + this.innerModel().withPeerIp(peerIp); + return this; + } + + 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..0a8845b7c6406 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import java.util.Collections; +import java.util.List; + +public final class BgpPeerStatusListResultImpl implements BgpPeerStatusListResult { + private BgpPeerStatusListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BgpPeerStatusListResultImpl( + BgpPeerStatusListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BgpPeerStatusListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.java new file mode 100644 index 0000000000000..25381ad803b3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.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.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..3b4afc24a0005 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.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.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 Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + private BgpServiceCommunitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..58025d6bf9209 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BgpServiceCommunityImpl implements BgpServiceCommunity { + private BgpServiceCommunityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BgpServiceCommunityImpl( + BgpServiceCommunityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String 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..444c265e4c760 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsClientImpl.java @@ -0,0 +1,1298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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..872bb8ad5fdcb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new VpnServerConfigurationPolicyGroupImpl(inner1, this.manager())); + } + + public VpnServerConfigurationPolicyGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + String configurationPolicyGroupName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + String configurationPolicyGroupName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + String configurationPolicyGroupName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + String configurationPolicyGroupName = Utils.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..a364beba16e6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import java.util.Collections; +import java.util.List; + +public final class ConnectionMonitorQueryResultImpl implements ConnectionMonitorQueryResult { + private ConnectionMonitorQueryResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionMonitorQueryResultImpl( + ConnectionMonitorQueryResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ConnectionMonitorSourceStatus sourceStatus() { + return this.innerModel().sourceStatus(); + } + + public List states() { + List inner = this.innerModel().states(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectionMonitorQueryResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 0000000000000..02da819e8520c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.connectionMonitorName = Utils.getValueFromIdByName(innerObject.id(), "connectionMonitors"); + } + + public ConnectionMonitorResult refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorResult refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitors() + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context) + .getValue(); + return this; + } + + public void stop() { + serviceManager.connectionMonitors().stop(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void stop(Context context) { + serviceManager.connectionMonitors().stop(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void start() { + serviceManager.connectionMonitors().start(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void start(Context context) { + serviceManager + .connectionMonitors() + .start(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorQueryResult query() { + return serviceManager.connectionMonitors().query(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public ConnectionMonitorQueryResult query(Context context) { + return serviceManager + .connectionMonitors() + .query(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorResultImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public ConnectionMonitorResultImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public ConnectionMonitorResultImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createParameters.withSource(source); + return this; + } + + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createParameters.withDestination(destination); + return this; + } + + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createParameters.withAutoStart(autoStart); + return this; + } + + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createParameters.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + public ConnectionMonitorResultImpl withEndpoints(List endpoints) { + this.createParameters.withEndpoints(endpoints); + return this; + } + + public ConnectionMonitorResultImpl withTestConfigurations( + List testConfigurations) { + this.createParameters.withTestConfigurations(testConfigurations); + return this; + } + + public ConnectionMonitorResultImpl withTestGroups(List testGroups) { + this.createParameters.withTestGroups(testGroups); + return this; + } + + public ConnectionMonitorResultImpl withOutputs(List outputs) { + this.createParameters.withOutputs(outputs); + return this; + } + + public ConnectionMonitorResultImpl withNotes(String notes) { + this.createParameters.withNotes(notes); + return this; + } + + public ConnectionMonitorResultImpl withMigrate(String migrate) { + this.createMigrate = migrate; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java new file mode 100644 index 0000000000000..6d016d79a5635 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java @@ -0,0 +1,2212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..a3d28b5c4d20d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.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.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 Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public ConnectionMonitorResult getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + private ConnectionMonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ConnectionMonitorResultImpl define(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..0667470d1eb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionResetSharedKey; + +public final class ConnectionResetSharedKeyImpl implements ConnectionResetSharedKey { + private ConnectionResetSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionResetSharedKeyImpl( + ConnectionResetSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int keyLength() { + return this.innerModel().keyLength(); + } + + public ConnectionResetSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..68dc4b2ad5aa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKey; + +public final class ConnectionSharedKeyImpl implements ConnectionSharedKey { + private ConnectionSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionSharedKeyImpl( + ConnectionSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String value() { + return this.innerModel().value(); + } + + public ConnectionSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..4b393157034f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = Utils.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..2f5dcc4821238 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsClientImpl.java @@ -0,0 +1,1189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list network 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list network 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..b1f439ce50b1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.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 Utils.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 Utils.mapPage(inner, inner1 -> new ConnectivityConfigurationImpl(inner1, this.manager())); + } + + public ConnectivityConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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..bf46680145f4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import java.util.Collections; +import java.util.List; + +public final class ConnectivityInformationImpl implements ConnectivityInformation { + private ConnectivityInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectivityInformationImpl( + ConnectivityInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List hops() { + List inner = this.innerModel().hops(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public Integer avgLatencyInMs() { + return this.innerModel().avgLatencyInMs(); + } + + public Integer minLatencyInMs() { + return this.innerModel().minLatencyInMs(); + } + + public Integer maxLatencyInMs() { + return this.innerModel().maxLatencyInMs(); + } + + public Integer probesSent() { + return this.innerModel().probesSent(); + } + + public Integer probesFailed() { + return this.innerModel().probesFailed(); + } + + public ConnectivityInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java new file mode 100644 index 0000000000000..c35795c19b04d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.customIpPrefixName = Utils.getValueFromIdByName(innerObject.id(), "customIpPrefixes"); + } + + public CustomIpPrefix refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CustomIpPrefix refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, context) + .getValue(); + return this; + } + + public CustomIpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CustomIpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CustomIpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CustomIpPrefixImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public CustomIpPrefixImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public CustomIpPrefixImpl 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..b61475559ee34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java @@ -0,0 +1,1453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b9384250e29a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public CustomIpPrefix getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, context); + } + + private CustomIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public CustomIpPrefixImpl define(String name) { + return new CustomIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java new file mode 100644 index 0000000000000..2d9ed98680d74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java @@ -0,0 +1,951 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..74dded11d81ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.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.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, context); + } + + private DdosCustomPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosCustomPolicyImpl define(String name) { + return new DdosCustomPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java new file mode 100644 index 0000000000000..7d4f030048bef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosCustomPolicyName = Utils.getValueFromIdByName(innerObject.id(), "ddosCustomPolicies"); + } + + public DdosCustomPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE) + .getValue(); + return this; + } + + public DdosCustomPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context) + .getValue(); + return this; + } + + public DdosCustomPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosCustomPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosCustomPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + 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..5c35ae8b2d120 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosProtectionPlanName = Utils.getValueFromIdByName(innerObject.id(), "ddosProtectionPlans"); + } + + public DdosProtectionPlan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE) + .getValue(); + return this; + } + + public DdosProtectionPlan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context) + .getValue(); + return this; + } + + public DdosProtectionPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosProtectionPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosProtectionPlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java new file mode 100644 index 0000000000000..84e18a74230e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java @@ -0,0 +1,1468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..270ab2c22a102 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public DdosProtectionPlan getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, context); + } + + private DdosProtectionPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosProtectionPlanImpl define(String name) { + return new DdosProtectionPlanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java new file mode 100644 index 0000000000000..408da93e12317 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..8c115f2ff8147 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public 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..97671920fcebb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; + +public final class DnsNameAvailabilityResultImpl implements DnsNameAvailabilityResult { + private DnsNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + DnsNameAvailabilityResultImpl( + DnsNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public DnsNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java new file mode 100644 index 0000000000000..152e1dfb1bb3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dscpConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "dscpConfigurations"); + } + + public DscpConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public DscpConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDscpConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context) + .getValue(); + return this; + } + + public DscpConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DscpConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DscpConfigurationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public DscpConfigurationImpl withMarkings(List markings) { + this.innerModel().withMarkings(markings); + return this; + } + + public DscpConfigurationImpl withSourceIpRanges(List sourceIpRanges) { + this.innerModel().withSourceIpRanges(sourceIpRanges); + return this; + } + + public DscpConfigurationImpl withDestinationIpRanges(List destinationIpRanges) { + this.innerModel().withDestinationIpRanges(destinationIpRanges); + return this; + } + + public DscpConfigurationImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public DscpConfigurationImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public DscpConfigurationImpl withProtocol(ProtocolType protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + 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..19f506a626439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java @@ -0,0 +1,1274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the DscpConfigurationList API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the DscpConfigurationList API service call 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..73468d57c6b50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public DscpConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, context); + } + + private DscpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DscpConfigurationImpl define(String name) { + return new DscpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..a7679f4199e4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveNetworkSecurityGroupListResultImpl implements EffectiveNetworkSecurityGroupListResult { + private EffectiveNetworkSecurityGroupListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveNetworkSecurityGroupListResultImpl( + EffectiveNetworkSecurityGroupListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveNetworkSecurityGroupListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..b632d72835726 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveRouteListResultImpl implements EffectiveRouteListResult { + private EffectiveRouteListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveRouteListResultImpl( + EffectiveRouteListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveRouteListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..3fc639dfa9eda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.EndpointServiceResult; + +public final class EndpointServiceResultImpl implements EndpointServiceResult { + private EndpointServiceResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EndpointServiceResultImpl( + EndpointServiceResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EndpointServiceResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..d8b3570aab880 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCircuitAuthorizationImpl + implements ExpressRouteCircuitAuthorization, + ExpressRouteCircuitAuthorization.Definition, + ExpressRouteCircuitAuthorization.Update { + private ExpressRouteCircuitAuthorizationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public AuthorizationUseStatus authorizationUseStatus() { + return this.innerModel().authorizationUseStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.authorizationName = Utils.getValueFromIdByName(innerObject.id(), "authorizations"); + } + + public ExpressRouteCircuitAuthorization refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorization refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus( + AuthorizationUseStatus authorizationUseStatus) { + this.innerModel().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java new file mode 100644 index 0000000000000..e564e2a090eaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java @@ -0,0 +1,1183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..674ca5c486c62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitAuthorization getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, authorizationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, circuitName, authorizationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, circuitName, authorizationName, context); + } + + private ExpressRouteCircuitAuthorizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..987fe3b529d5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public ExpressRouteCircuitConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.innerModel().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering( + SubResource peerExpressRouteCircuitPeering) { + this.innerModel().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitConnectionImpl withIpv6CircuitConnectionConfig( + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig) { + this.innerModel().withIpv6CircuitConnectionConfig(ipv6CircuitConnectionConfig); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..c58de0ded2cd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..24c4706957fc1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + private ExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitConnectionImpl define(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..e81fdcb2b3ae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + } + + public ExpressRouteCircuit refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuit refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteCircuitImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteCircuitImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.innerModel().withAllowClassicOperations(allowClassicOperations); + return this; + } + + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.innerModel().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.innerModel().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.innerModel().withAuthorizations(authorizations); + return this; + } + + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.innerModel().withPeerings(peerings); + return this; + } + + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.innerModel().withServiceKey(serviceKey); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.innerModel().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProperties( + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.innerModel().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + public ExpressRouteCircuitImpl withExpressRoutePort(SubResource expressRoutePort) { + this.innerModel().withExpressRoutePort(expressRoutePort); + return this; + } + + public ExpressRouteCircuitImpl withBandwidthInGbps(Float bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitImpl withGlobalReachEnabled(Boolean globalReachEnabled) { + this.innerModel().withGlobalReachEnabled(globalReachEnabled); + return this; + } + + public ExpressRouteCircuitImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + 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..c9240a1ab5b13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public ExpressRouteCircuitPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.innerModel().withPeeringType(peeringType); + return this; + } + + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.innerModel().withState(state); + return this; + } + + public ExpressRouteCircuitPeeringImpl withAzureAsn(Integer azureAsn) { + this.innerModel().withAzureAsn(azureAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.innerModel().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.innerModel().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.innerModel().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.innerModel().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.innerModel().withSharedKey(sharedKey); + return this; + } + + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.innerModel().withVlanId(vlanId); + return this; + } + + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.innerModel().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.innerModel().withStats(stats); + return this; + } + + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitPeeringImpl withRouteFilter(SubResource routeFilter) { + this.innerModel().withRouteFilter(routeFilter); + return this; + } + + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig( + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.innerModel().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.innerModel().withExpressRouteConnection(expressRouteConnection); + return this; + } + + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.innerModel().withConnections(connections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..d9567481388d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringPropertiesFormatImpl.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.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..320a1a202b7cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java @@ -0,0 +1,1151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..c22c0aa0b2fe0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, context); + } + + private ExpressRouteCircuitPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitPeeringImpl define(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..faf12e8c1596a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; + +public final class ExpressRouteCircuitStatsImpl implements ExpressRouteCircuitStats { + private ExpressRouteCircuitStatsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitStatsImpl( + ExpressRouteCircuitStatsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long primarybytesIn() { + return this.innerModel().primarybytesIn(); + } + + public Long primarybytesOut() { + return this.innerModel().primarybytesOut(); + } + + public Long secondarybytesIn() { + return this.innerModel().secondarybytesIn(); + } + + public Long secondarybytesOut() { + return this.innerModel().secondarybytesOut(); + } + + public ExpressRouteCircuitStatsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..f97a3b071ce5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsArpTableListResultImpl implements ExpressRouteCircuitsArpTableListResult { + private ExpressRouteCircuitsArpTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsArpTableListResultImpl( + ExpressRouteCircuitsArpTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsArpTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java new file mode 100644 index 0000000000000..b0a09641d8a64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java @@ -0,0 +1,2756 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + 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< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, 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< + PollResult, 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 = "2022-09-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 = "2022-09-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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + 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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, 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< + PollResult, 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 = "2022-09-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 = "2022-09-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< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + 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< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, circuitName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + ExpressRouteCircuitsRoutesTableSummaryListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, + 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< + PollResult, + 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCircuit API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCircuit API service call 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..6939995a5e0e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public ExpressRouteCircuit getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, context); + } + + private ExpressRouteCircuitsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitImpl define(String name) { + return new ExpressRouteCircuitImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..382f256d5259a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableListResultImpl implements ExpressRouteCircuitsRoutesTableListResult { + private ExpressRouteCircuitsRoutesTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableListResultImpl( + ExpressRouteCircuitsRoutesTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..0de4999c4953d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableSummaryListResultImpl + implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableSummaryListResultImpl( + ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java new file mode 100644 index 0000000000000..95f5943ac289e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.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.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..78141ec0b225e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteConnectionListImpl implements ExpressRouteConnectionList { + private ExpressRouteConnectionListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteConnectionListImpl( + ExpressRouteConnectionListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteConnectionListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java new file mode 100644 index 0000000000000..d0810b99b9e5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java @@ -0,0 +1,1069 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..258b2fddf3852 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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..f9deb65a41402 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.crossConnectionName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCrossConnections"); + } + + public ExpressRouteCrossConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCrossConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCrossConnections() + .getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context) + .getValue(); + return this; + } + + public ExpressRouteCrossConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteCrossConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteCrossConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCrossConnectionParameters.withTags(tags); + return this; + } + } + + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.innerModel().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.innerModel().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.innerModel().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.innerModel().withPeerings(peerings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 0000000000000..8a557bbceaf0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCrossConnectionPeeringImpl implements ExpressRouteCrossConnectionPeering { + private ExpressRouteCrossConnectionPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCrossConnectionPeeringImpl( + ExpressRouteCrossConnectionPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ExpressRoutePeeringType peeringType() { + return this.innerModel().peeringType(); + } + + public ExpressRoutePeeringState state() { + return this.innerModel().state(); + } + + public Integer azureAsn() { + return this.innerModel().azureAsn(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String primaryPeerAddressPrefix() { + return this.innerModel().primaryPeerAddressPrefix(); + } + + public String secondaryPeerAddressPrefix() { + return this.innerModel().secondaryPeerAddressPrefix(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Integer vlanId() { + return this.innerModel().vlanId(); + } + + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerModel().microsoftPeeringConfig(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String gatewayManagerEtag() { + return this.innerModel().gatewayManagerEtag(); + } + + public String lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerModel().ipv6PeeringConfig(); + } + + public ExpressRouteCrossConnectionPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java new file mode 100644 index 0000000000000..f0ab6ea70263c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java @@ -0,0 +1,1183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..476372ec8888f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, crossConnectionName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName, context); + } + + public 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..9337db6a76c2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java @@ -0,0 +1,2283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCrossConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject crossConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listArpTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary" + + "/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTableSummary( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 = "2022-09-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 = "2022-09-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 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() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + 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< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTableAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsArpTableListResultInner.class, + ExpressRouteCircuitsArpTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, 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< + PollResult, 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 = "2022-09-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 = "2022-09-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< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableSummaryWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + 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< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummaryAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableSummaryWithResponseAsync( + resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, + context); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, + 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< + PollResult, + 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 = "2022-09-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 = "2022-09-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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + 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< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTableAsync( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteCircuitsRoutesTableListResultInner.class, + ExpressRouteCircuitsRoutesTableListResultInner.class, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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< + PollResult, 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< + PollResult, 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..d2f058b53af85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context); + } + + private ExpressRouteCrossConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCrossConnectionImpl define(String name) { + return new ExpressRouteCrossConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..153898b8c502f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl + implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl( + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java new file mode 100644 index 0000000000000..338e01e45dbda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRouteGatewayName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteGateways"); + } + + public ExpressRouteGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context) + .getValue(); + return this; + } + + public ExpressRouteGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateExpressRouteGatewayParameters.withTags(tags); + return this; + } + } + + public ExpressRouteGatewayImpl withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.innerModel().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + public ExpressRouteGatewayImpl 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..3da3af53a8f27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteGatewayListImpl implements ExpressRouteGatewayList { + private ExpressRouteGatewayListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteGatewayListImpl( + ExpressRouteGatewayListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteGatewayImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteGatewayListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java new file mode 100644 index 0000000000000..f6587f40ab01d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java @@ -0,0 +1,1404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..1b20072781512 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, context); + } + + private ExpressRouteGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteGatewayImpl define(String name) { + return new ExpressRouteGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java new file mode 100644 index 0000000000000..a09cc309b1ce4 --- /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..c2c4c2da17cd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..91d238a0209f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, expressRoutePortName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + private ExpressRouteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..196e852ceeebb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = Utils.getValueFromIdByName(innerObject.id(), "expressRoutePorts"); + this.authorizationName = Utils.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..a81a8334b70ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java @@ -0,0 +1,1198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..1e67a2acd5ede --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.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 Utils.mapPage(inner, inner1 -> new ExpressRoutePortAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRoutePortAuthorization getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "expressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRoutePorts'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this + .getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "expressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRoutePorts'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "expressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRoutePorts'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, authorizationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "expressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRoutePorts'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, 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..d93d3ec3e0049 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = Utils.getValueFromIdByName(innerObject.id(), "ExpressRoutePorts"); + } + + public ExpressRoutePort refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePort refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context) + .getValue(); + return this; + } + + public ExpressRoutePortImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRoutePortImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRoutePortImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRoutePortImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ExpressRoutePortImpl withPeeringLocation(String peeringLocation) { + this.innerModel().withPeeringLocation(peeringLocation); + return this; + } + + public ExpressRoutePortImpl withBandwidthInGbps(Integer bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRoutePortImpl withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.innerModel().withEncapsulation(encapsulation); + return this; + } + + public ExpressRoutePortImpl withLinks(List links) { + this.innerModel().withLinks(links); + return this; + } + + 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..b6c28fc5fedf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java @@ -0,0 +1,1632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..66dbb572537f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.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 Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, context); + } + + private ExpressRoutePortsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRoutePortImpl define(String name) { + return new ExpressRoutePortImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java new file mode 100644 index 0000000000000..74ed4468fa807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocation; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ExpressRoutePortsLocationImpl implements ExpressRoutePortsLocation { + private ExpressRoutePortsLocationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRoutePortsLocationImpl( + ExpressRoutePortsLocationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String 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..a1c00a512a5d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..93b39f8a875a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public 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..c9cdf72753127 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortImpl.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.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..1ea36366db17d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortListResultImpl.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.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..3c3f4023944f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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..2674e478f112a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsImpl.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.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..0f7cf020c1a97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProvider; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ExpressRouteServiceProviderImpl implements ExpressRouteServiceProvider { + private ExpressRouteServiceProviderInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteServiceProviderImpl( + ExpressRouteServiceProviderInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public 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..5cddc39e35032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..7c8010cbeb34c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.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.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 Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + private ExpressRouteServiceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..1be78425a0e1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java @@ -0,0 +1,1451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call 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..96f48b019beb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public FirewallPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, context); + } + + private FirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyImpl define(String name) { + return new FirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..6f9265fc18247 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesClientImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2022-09-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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2022-09-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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..76e7b68490f15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.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.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 Describes the filter values possibles for a given column. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2022-09-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 Describes the filter values possibles for a given column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2022-09-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 Describes the filter values possibles for a given column. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Describes the filter values possibles for a given column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Describes the filter values possibles for a given column. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..aff8640e3d2c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.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.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..f10a3a2ec86f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesImpl.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.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..a1b1657d38c47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesClientImpl.java @@ -0,0 +1,758 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..196947241598b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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..f9be8a6cb20f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + } + + public FirewallPolicy refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicy refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, context) + .getValue(); + return this; + } + + public FirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FirewallPolicyImpl withTags(Map tags) { + 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/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..cf7b4c8564877 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.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.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class FirewallPolicyRuleCollectionGroupImpl + implements FirewallPolicyRuleCollectionGroup, + FirewallPolicyRuleCollectionGroup.Definition, + FirewallPolicyRuleCollectionGroup.Update { + private FirewallPolicyRuleCollectionGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public List ruleCollections() { + List inner = this.innerModel().ruleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + this.ruleCollectionGroupName = Utils.getValueFromIdByName(innerObject.id(), "ruleCollectionGroups"); + } + + public FirewallPolicyRuleCollectionGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withRuleCollections( + List ruleCollections) { + this.innerModel().withRuleCollections(ruleCollections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java new file mode 100644 index 0000000000000..5bd086f18fb96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java @@ -0,0 +1,1191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..3b12e2ec73808 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.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.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 Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, firewallPolicyName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public FirewallPolicyRuleCollectionGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this.getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + private FirewallPolicyRuleCollectionGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyRuleCollectionGroupImpl define(String name) { + return new FirewallPolicyRuleCollectionGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java new file mode 100644 index 0000000000000..67925cdd4e265 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import java.util.Collections; +import java.util.Map; + +public final class FlowLogImpl implements FlowLog, FlowLog.Definition, FlowLog.Update { + private FlowLogInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.flowLogName = Utils.getValueFromIdByName(innerObject.id(), "flowLogs"); + } + + public FlowLog refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .getWithResponse(resourceGroupName, networkWatcherName, flowLogName, Context.NONE) + .getValue(); + return this; + } + + public FlowLog refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFlowLogs() + .getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context) + .getValue(); + return this; + } + + public FlowLogImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FlowLogImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FlowLogImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public FlowLogImpl withTargetResourceId(String targetResourceId) { + this.innerModel().withTargetResourceId(targetResourceId); + return this; + } + + public FlowLogImpl withStorageId(String storageId) { + this.innerModel().withStorageId(storageId); + return this; + } + + public FlowLogImpl withEnabled(Boolean enabled) { + this.innerModel().withEnabled(enabled); + return this; + } + + public FlowLogImpl withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.innerModel().withRetentionPolicy(retentionPolicy); + return this; + } + + public FlowLogImpl withFormat(FlowLogFormatParameters format) { + this.innerModel().withFormat(format); + return this; + } + + public FlowLogImpl withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.innerModel().withFlowAnalyticsConfiguration(flowAnalyticsConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java new file mode 100644 index 0000000000000..85b87d5fd8145 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; + +public final class FlowLogInformationImpl implements FlowLogInformation { + private FlowLogInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FlowLogInformationImpl( + FlowLogInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.innerModel().flowAnalyticsConfiguration(); + } + + public String storageId() { + return this.innerModel().storageId(); + } + + public boolean enabled() { + return this.innerModel().enabled(); + } + + public RetentionPolicyParameters retentionPolicy() { + return this.innerModel().retentionPolicy(); + } + + public FlowLogFormatParameters format() { + return this.innerModel().format(); + } + + public FlowLogInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java new file mode 100644 index 0000000000000..7a499c5392915 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java @@ -0,0 +1,1326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b02b8b3a2ff6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public FlowLog getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, context); + } + + private FlowLogsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FlowLogImpl define(String name) { + return new FlowLogImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java new file mode 100644 index 0000000000000..29fee3d0da41c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import java.util.Collections; +import java.util.List; + +public final class FrontendIpConfigurationImpl implements FrontendIpConfiguration { + private FrontendIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FrontendIpConfigurationImpl( + FrontendIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatPools() { + List inner = this.innerModel().inboundNatPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource publicIpPrefix() { + return this.innerModel().publicIpPrefix(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public FrontendIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..e97cd17db7576 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationPropertiesFormatImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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..6e59c4256f1fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import java.util.Collections; +import java.util.List; + +public final class GatewayRouteListResultImpl implements GatewayRouteListResult { + private GatewayRouteListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + GatewayRouteListResultImpl( + GatewayRouteListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GatewayRouteListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java new file mode 100644 index 0000000000000..2c58295ce6f0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaResult; + +public final class GenerateExpressRoutePortsLoaResultImpl implements GenerateExpressRoutePortsLoaResult { + private GenerateExpressRoutePortsLoaResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + GenerateExpressRoutePortsLoaResultImpl( + GenerateExpressRoutePortsLoaResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String encodedContent() { + return this.innerModel().encodedContent(); + } + + public GenerateExpressRoutePortsLoaResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java new file mode 100644 index 0000000000000..ea4b6400f9a7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.ipConfigName = Utils.getValueFromIdByName(innerObject.id(), "ipConfigurations"); + } + + public HubIpConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE) + .getValue(); + return this; + } + + public HubIpConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context) + .getValue(); + return this; + } + + public HubIpConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAddress(String privateIpAddress) { + this.innerModel().withPrivateIpAddress(privateIpAddress); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.innerModel().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + public HubIpConfigurationImpl withSubnet(SubnetInner subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public HubIpConfigurationImpl withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.innerModel().withPublicIpAddress(publicIpAddress); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..7866c0aeb2e87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationPropertiesFormatImpl.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.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..822bdd822652c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "hubRouteTables"); + } + + public HubRouteTable refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE) + .getValue(); + return this; + } + + public HubRouteTable refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, context) + .getValue(); + return this; + } + + public HubRouteTableImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubRouteTableImpl withRoutes(List routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public HubRouteTableImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java new file mode 100644 index 0000000000000..a84c12558a318 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..c5e1ba7c744a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public HubRouteTable getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + private HubRouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubRouteTableImpl define(String name) { + return new HubRouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..3abf014d6dbb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; + +public final class HubVirtualNetworkConnectionImpl implements HubVirtualNetworkConnection { + private HubVirtualNetworkConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + HubVirtualNetworkConnectionImpl( + HubVirtualNetworkConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVirtualNetwork() { + return this.innerModel().remoteVirtualNetwork(); + } + + public Boolean allowHubToRemoteVnetTransit() { + return this.innerModel().allowHubToRemoteVnetTransit(); + } + + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.innerModel().allowRemoteVnetToUseHubVnetGateways(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubVirtualNetworkConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java new file mode 100644 index 0000000000000..49aa373bdf161 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java @@ -0,0 +1,1185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..5f1f8b8dd0afd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.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.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 Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + private HubVirtualNetworkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..559898ba9aae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.inboundNatRuleName = Utils.getValueFromIdByName(innerObject.id(), "inboundNatRules"); + } + + public InboundNatRule refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public InboundNatRule refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getInboundNatRules() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, context) + .getValue(); + return this; + } + + public InboundNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundNatRuleImpl withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + this.innerModel().withFrontendIpConfiguration(frontendIpConfiguration); + return this; + } + + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.innerModel().withFrontendPort(frontendPort); + return this; + } + + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.innerModel().withBackendPort(backendPort); + return this; + } + + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public InboundNatRuleImpl withEnableFloatingIp(Boolean enableFloatingIp) { + this.innerModel().withEnableFloatingIp(enableFloatingIp); + return this; + } + + public InboundNatRuleImpl withEnableTcpReset(Boolean enableTcpReset) { + this.innerModel().withEnableTcpReset(enableTcpReset); + return this; + } + + 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..0f1769431a70e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulePropertiesFormatImpl.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.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..ff03c094d45be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java @@ -0,0 +1,1177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..d094c4af2126a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + private InboundNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundNatRuleImpl define(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java new file mode 100644 index 0000000000000..4f7c028d789f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRule; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class InboundSecurityRuleImpl + implements InboundSecurityRule, InboundSecurityRule.Definition, InboundSecurityRule.Update { + private InboundSecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.ruleCollectionName = Utils.getValueFromIdByName(innerObject.id(), "inboundSecurityRules"); + } + + public InboundSecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundSecurityRuleImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java new file mode 100644 index 0000000000000..7c08ced1fac8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.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.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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); + } + + /** + * 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 = "2022-09-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 = "2022-09-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(); + } +} 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..668e5c86d4086 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.InboundSecurityRuleOperationsClient; +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; + } + + private InboundSecurityRuleOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundSecurityRuleImpl define(String name) { + return new InboundSecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..9acfd5a78fa45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.IpAddressAvailabilityResult; +import java.util.Collections; +import java.util.List; + +public final class IpAddressAvailabilityResultImpl implements IpAddressAvailabilityResult { + private IpAddressAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpAddressAvailabilityResultImpl( + IpAddressAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public List availableIpAddresses() { + List inner = this.innerModel().availableIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isPlatformReserved() { + return this.innerModel().isPlatformReserved(); + } + + public IpAddressAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java new file mode 100644 index 0000000000000..5f2ff0244858f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipAllocationName = Utils.getValueFromIdByName(innerObject.id(), "IpAllocations"); + } + + public IpAllocation refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public IpAllocation refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpAllocations() + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, context) + .getValue(); + return this; + } + + public IpAllocationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpAllocationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpAllocationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public IpAllocationImpl withTypePropertiesType(IpAllocationType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public IpAllocationImpl withPrefix(String prefix) { + this.innerModel().withPrefix(prefix); + return this; + } + + public IpAllocationImpl withPrefixLength(Integer prefixLength) { + this.innerModel().withPrefixLength(prefixLength); + return this; + } + + public IpAllocationImpl withPrefixType(IpVersion prefixType) { + this.innerModel().withPrefixType(prefixType); + return this; + } + + public IpAllocationImpl withIpamAllocationId(String ipamAllocationId) { + this.innerModel().withIpamAllocationId(ipamAllocationId); + return this; + } + + public IpAllocationImpl withAllocationTags(Map allocationTags) { + this.innerModel().withAllocationTags(allocationTags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java new file mode 100644 index 0000000000000..7ccd3557b1a10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java @@ -0,0 +1,1454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..dd7e3779a7582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.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.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 Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public IpAllocation getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, context); + } + + private IpAllocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpAllocationImpl define(String name) { + return new IpAllocationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java new file mode 100644 index 0000000000000..94b3d94e69eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationImpl implements IpConfiguration { + private IpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationImpl( + IpConfigurationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java new file mode 100644 index 0000000000000..cf80d21f457c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationProfileImpl implements IpConfigurationProfile { + private IpConfigurationProfileInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationProfileImpl( + IpConfigurationProfileInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..99ac55e0f9252 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfilePropertiesFormatImpl.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.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..465da9497a2b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationPropertiesFormatImpl.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.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..022abac0c5899 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipGroupsName = Utils.getValueFromIdByName(innerObject.id(), "ipGroups"); + } + + public IpGroup refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public IpGroup refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getIpGroups() + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, context) + .getValue(); + return this; + } + + public IpGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public IpGroupImpl withIpAddresses(List ipAddresses) { + this.innerModel().withIpAddresses(ipAddresses); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java new file mode 100644 index 0000000000000..a992c531dbb37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java @@ -0,0 +1,1432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..e5d0f83bffb62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.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.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 Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public IpGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, context); + } + + private IpGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpGroupImpl define(String name) { + return new IpGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..c183d54279fe5 --- /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..c48e8e41e0a71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java @@ -0,0 +1,1174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..2b92d5b46188c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.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.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 Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + private LoadBalancerBackendAddressPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BackendAddressPoolImpl define(String name) { + return new BackendAddressPoolImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..e374b612bd87b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..e3ae8e9a6a5fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public 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..032b7efc85ed9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + } + + public LoadBalancer refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public LoadBalancer refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, context) + .getValue(); + return this; + } + + public LoadBalancerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LoadBalancerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LoadBalancerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LoadBalancerImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public LoadBalancerImpl withFrontendIpConfigurations(List frontendIpConfigurations) { + this.innerModel().withFrontendIpConfigurations(frontendIpConfigurations); + return this; + } + + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.innerModel().withBackendAddressPools(backendAddressPools); + return this; + } + + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.innerModel().withLoadBalancingRules(loadBalancingRules); + return this; + } + + public LoadBalancerImpl withProbes(List probes) { + this.innerModel().withProbes(probes); + return this; + } + + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.innerModel().withInboundNatRules(inboundNatRules); + return this; + } + + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.innerModel().withInboundNatPools(inboundNatPools); + return this; + } + + public LoadBalancerImpl withOutboundRules(List outboundRules) { + this.innerModel().withOutboundRules(outboundRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java new file mode 100644 index 0000000000000..45ff1005c833c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ca24e5e4b906c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public 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..deaa8e10386bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..13df05d3e0d26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + private LoadBalancerNetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java new file mode 100644 index 0000000000000..9923716a0c766 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..7eee27727b08e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public 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..802717e583fc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b36c7fdfbe4d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.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.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 Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public 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..89e27eb4c4bb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java @@ -0,0 +1,2067 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.models.LoadBalancerListResult; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +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"}) + @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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, 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< + PollResult, 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< + PollResult, 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< + PollResult, 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancers API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..59228b11491ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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.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.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 Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters) { + this.serviceClient().swapPublicIpAddresses(location, parameters); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context) { + this.serviceClient().swapPublicIpAddresses(location, parameters, context); + } + + public 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 LoadBalancer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, context); + } + + private LoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public LoadBalancerImpl define(String name) { + return new LoadBalancerImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 0000000000000..0ec7a3ed5b23e --- /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..47bf17aa603af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "localNetworkGateways"); + } + + public LocalNetworkGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, Context.NONE) + .getValue(); + return this; + } + + public LocalNetworkGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context) + .getValue(); + return this; + } + + public LocalNetworkGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LocalNetworkGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LocalNetworkGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.innerModel().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.innerModel().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + public LocalNetworkGatewayImpl withFqdn(String fqdn) { + this.innerModel().withFqdn(fqdn); + return this; + } + + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java new file mode 100644 index 0000000000000..4257014e97dc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java @@ -0,0 +1,1251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..de14d7bca0292 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.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.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 Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public LocalNetworkGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, context); + } + + private LocalNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public LocalNetworkGatewayImpl define(String name) { + return new LocalNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..0c7d827fed2b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsClientImpl.java @@ -0,0 +1,846 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..1829222445ba4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsImpl.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.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 Utils.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 Utils.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/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..e0fa89fbaa5a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.natGatewayName = Utils.getValueFromIdByName(innerObject.id(), "natGateways"); + } + + public NatGateway refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NatGateway refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNatGateways() + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, context) + .getValue(); + return this; + } + + public NatGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NatGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NatGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NatGatewayImpl withSku(NatGatewaySku sku) { + this.innerModel().withSku(sku); + return this; + } + + public NatGatewayImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public NatGatewayImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public NatGatewayImpl withPublicIpAddresses(List publicIpAddresses) { + this.innerModel().withPublicIpAddresses(publicIpAddresses); + return this; + } + + public NatGatewayImpl withPublicIpPrefixes(List publicIpPrefixes) { + this.innerModel().withPublicIpPrefixes(publicIpPrefixes); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java new file mode 100644 index 0000000000000..f971859eb18ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java @@ -0,0 +1,1441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b84102d2a53ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.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.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 Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public NatGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, context); + } + + private NatGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NatGatewayImpl define(String name) { + return new NatGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java new file mode 100644 index 0000000000000..6cd322158b32c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java @@ -0,0 +1,1131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway 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..1bc237cb3e838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public VpnGatewayNatRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, context); + } + + private NatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayNatRuleImpl define(String name) { + return new VpnGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..b82442ab8e941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkConfigurationDiagnosticResponseImpl implements NetworkConfigurationDiagnosticResponse { + private NetworkConfigurationDiagnosticResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkConfigurationDiagnosticResponseImpl( + NetworkConfigurationDiagnosticResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkConfigurationDiagnosticResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..7bbcf3c5a5a77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.networkGroupName = Utils.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 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..9422dc701efc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsClientImpl.java @@ -0,0 +1,1154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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..4ec453deae881 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new NetworkGroupImpl(inner1, this.manager())); + } + + public NetworkGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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..d776f7763deeb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + } + + public NetworkInterface refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, context) + .getValue(); + return this; + } + + public EffectiveRouteListResult getEffectiveRouteTable() { + return serviceManager.networkInterfaces().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + } + + public EffectiveRouteListResult getEffectiveRouteTable(Context context) { + return serviceManager + .networkInterfaces() + .getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups() { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(Context context) { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + } + + public NetworkInterfaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkInterfaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkInterfaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkInterfaceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.innerModel().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + public NetworkInterfaceImpl 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; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java new file mode 100644 index 0000000000000..8c5e4fb7af7a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkInterfaceIpConfigurationImpl implements NetworkInterfaceIpConfiguration { + private NetworkInterfaceIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfaceIpConfigurationImpl( + NetworkInterfaceIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public List virtualNetworkTaps() { + List inner = this.innerModel().virtualNetworkTaps(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List applicationGatewayBackendAddressPools() { + List inner = this.innerModel().applicationGatewayBackendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerBackendAddressPools() { + List inner = this.innerModel().loadBalancerBackendAddressPools(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new BackendAddressPoolImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerInboundNatRules() { + List inner = this.innerModel().loadBalancerInboundNatRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new InboundNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public List applicationSecurityGroups() { + List inner = this.innerModel().applicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties() { + return this.innerModel().privateLinkConnectionProperties(); + } + + public NetworkInterfaceIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..0ece4cebb8646 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationPropertiesFormatImpl.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.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 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..280ebae26b816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..bcae53057d04c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public 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..0587f468d38a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..280e2740c55b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.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.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 Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + private NetworkInterfaceLoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..83772debbc160 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacePropertiesFormatImpl.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.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.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 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..bb4f7a0129ae2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + this.tapConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "tapConfigurations"); + } + + public NetworkInterfaceTapConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.innerModel().withVirtualNetworkTap(virtualNetworkTap); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..4ac295fbc85bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java @@ -0,0 +1,1194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b8d58cd259db3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceTapConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + private NetworkInterfaceTapConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceTapConfigurationImpl define(String name) { + return new NetworkInterfaceTapConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java new file mode 100644 index 0000000000000..610f78da4fc6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java @@ -0,0 +1,4426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, 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< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroupsAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EffectiveNetworkSecurityGroupListResultInner.class, + EffectiveNetworkSecurityGroupListResultInner.class, + context); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, 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< + PollResult, 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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..98ceb220f775f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstanceNetworkInterfaces( + resourceGroupName, cloudServiceName, roleInstanceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public EffectiveRouteListResult getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteListResult getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetIpConfigurations( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, context); + } + + private NetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceImpl define(String name) { + return new NetworkInterfaceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java new file mode 100644 index 0000000000000..e37f08012f963 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.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.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, + 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..60e6dc8368727 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,2107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.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.FirewallPolicyIdpsSignaturesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesFilterValuesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesOverridesClient; +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.NetworkManagersClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.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.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.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 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 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 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.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.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.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(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..9c37baecad809 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.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..c9da62b4cec08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsClientImpl.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.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 = "2022-09-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 = "2022-09-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..afabfe510bafb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsImpl.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.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..bca9d3acd118a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerConnectionImpl.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.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 = Utils.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..d65fd38ba728a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusListResultImpl.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.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..8484bb6e9bc78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsClientImpl.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.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 = "2022-09-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 = "2022-09-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..c550b32dfd41f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsImpl.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.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..04416197395b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.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/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..11544e1f151a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersClientImpl.java @@ -0,0 +1,1512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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..e828d7b433a7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.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 Utils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public NetworkManager getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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..d7a3721da1f8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkProfileName = Utils.getValueFromIdByName(innerObject.id(), "networkProfiles"); + } + + public NetworkProfile refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkProfile refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkProfiles() + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, context) + .getValue(); + return this; + } + + public NetworkProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkProfileImpl withContainerNetworkInterfaceConfigurations( + List containerNetworkInterfaceConfigurations) { + this.innerModel().withContainerNetworkInterfaceConfigurations(containerNetworkInterfaceConfigurations); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java new file mode 100644 index 0000000000000..9c7cd13b81288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,1345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..873daec1f5f55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public NetworkProfile getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, context); + } + + private NetworkProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkProfileImpl define(String name) { + return new NetworkProfileImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..d6b7499e35604 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + } + + public NetworkSecurityGroup refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkSecurityGroup refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, context) + .getValue(); + return this; + } + + public NetworkSecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkSecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkSecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkSecurityGroupImpl 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..4751485c16672 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java @@ -0,0 +1,1489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..05a6bf33499ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public NetworkSecurityGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, context); + } + + private NetworkSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkSecurityGroupImpl define(String name) { + return new NetworkSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java new file mode 100644 index 0000000000000..63e500059ead3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +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.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 List virtualApplianceSites() { + List inner = this.innerModel().virtualApplianceSites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundSecurityRules() { + List inner = this.innerModel().inboundSecurityRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + } + + public NetworkVirtualAppliance refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse( + resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkVirtualAppliance refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, context) + .getValue(); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkVirtualApplianceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkVirtualApplianceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public NetworkVirtualApplianceImpl withNvaSku(VirtualApplianceSkuProperties nvaSku) { + this.innerModel().withNvaSku(nvaSku); + return this; + } + + public NetworkVirtualApplianceImpl withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs) { + this.innerModel().withBootStrapConfigurationBlobs(bootStrapConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs) { + this.innerModel().withCloudInitConfigurationBlobs(cloudInitConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfiguration(String cloudInitConfiguration) { + this.innerModel().withCloudInitConfiguration(cloudInitConfiguration); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualApplianceAsn(Long virtualApplianceAsn) { + this.innerModel().withVirtualApplianceAsn(virtualApplianceAsn); + return this; + } + + public NetworkVirtualApplianceImpl withSshPublicKey(String sshPublicKey) { + this.innerModel().withSshPublicKey(sshPublicKey); + 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/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..f6cccd2612c9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSku; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkVirtualApplianceSkuImpl implements NetworkVirtualApplianceSku { + private NetworkVirtualApplianceSkuInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkVirtualApplianceSkuImpl( + NetworkVirtualApplianceSkuInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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..b799a0f979cd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java @@ -0,0 +1,1508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkVirtualAppliancesClient. */ +public final class NetworkVirtualAppliancesClientImpl implements NetworkVirtualAppliancesClient { + /** 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"}) + @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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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(); + } + + /** + * 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..732a902a297aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.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.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; + +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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public NetworkVirtualAppliance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, context); + } + + private NetworkVirtualAppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkVirtualApplianceImpl define(String name) { + return new NetworkVirtualApplianceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..8c85b9f3f95e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + } + + public NetworkWatcher refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context) + .getValue(); + return this; + } + + public 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..56e3880669781 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java @@ -0,0 +1,4760 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnosticAsync( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + Mono>> mono = + getNetworkConfigurationDiagnosticWithResponseAsync(resourceGroupName, networkWatcherName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkConfigurationDiagnosticResponseInner.class, + NetworkConfigurationDiagnosticResponseInner.class, + 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< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnosticAsync( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getNetworkConfigurationDiagnosticWithResponseAsync( + resourceGroupName, networkWatcherName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkConfigurationDiagnosticResponseInner.class, + NetworkConfigurationDiagnosticResponseInner.class, + context); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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< + PollResult, 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< + PollResult, 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..22c8499dbab0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, context); + } + + private NetworkWatchersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkWatcherImpl define(String name) { + return new NetworkWatcherImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..0c4e1ff61a3e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.NextHopType; + +public final class NextHopResultImpl implements NextHopResult { + private NextHopResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NextHopResultImpl( + NextHopResultInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public NextHopType nextHopType() { + return this.innerModel().nextHopType(); + } + + public String nextHopIpAddress() { + return this.innerModel().nextHopIpAddress(); + } + + public String routeTableId() { + return this.innerModel().routeTableId(); + } + + public NextHopResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..25788ef01c972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.Operation; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..41777323c7adc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..999d4647bcb7f --- /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 Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java new file mode 100644 index 0000000000000..cd6f2369e6839 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class OutboundRuleImpl implements OutboundRule { + private OutboundRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OutboundRuleImpl( + OutboundRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer allocatedOutboundPorts() { + return this.innerModel().allocatedOutboundPorts(); + } + + public List frontendIpConfigurations() { + List inner = this.innerModel().frontendIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public LoadBalancerOutboundRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public Boolean enableTcpReset() { + return this.innerModel().enableTcpReset(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public OutboundRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java new file mode 100644 index 0000000000000..1d28a813c1849 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; + +public final class P2SVpnConnectionHealthImpl implements P2SVpnConnectionHealth { + private P2SVpnConnectionHealthInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + P2SVpnConnectionHealthImpl( + P2SVpnConnectionHealthInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sasUrl() { + return this.innerModel().sasUrl(); + } + + public P2SVpnConnectionHealthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java new file mode 100644 index 0000000000000..4d2152ef1e385 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "p2svpnGateways"); + } + + public P2SVpnGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public P2SVpnGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getP2SVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, context) + .getValue(); + return this; + } + + public P2SVpnGateway reset() { + return serviceManager.p2SVpnGateways().reset(resourceGroupName, gatewayName); + } + + public P2SVpnGateway reset(Context context) { + return serviceManager.p2SVpnGateways().reset(resourceGroupName, gatewayName, context); + } + + public VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters) { + return serviceManager.p2SVpnGateways().generateVpnProfile(resourceGroupName, gatewayName, parameters); + } + + public VpnProfileResponse generateVpnProfile(P2SVpnProfileParameters parameters, Context context) { + return serviceManager.p2SVpnGateways().generateVpnProfile(resourceGroupName, gatewayName, parameters, context); + } + + public P2SVpnGateway getP2SVpnConnectionHealth() { + return serviceManager.p2SVpnGateways().getP2SVpnConnectionHealth(resourceGroupName, gatewayName); + } + + public P2SVpnGateway getP2SVpnConnectionHealth(Context context) { + return serviceManager.p2SVpnGateways().getP2SVpnConnectionHealth(resourceGroupName, gatewayName, context); + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed(P2SVpnConnectionHealthRequest request) { + return serviceManager + .p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request); + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + P2SVpnConnectionHealthRequest request, Context context) { + return serviceManager + .p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request, context); + } + + public P2SVpnGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public P2SVpnGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public P2SVpnGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateP2SVpnGatewayParameters.withTags(tags); + return this; + } + } + + public P2SVpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public P2SVpnGatewayImpl withP2SConnectionConfigurations( + List p2SConnectionConfigurations) { + this.innerModel().withP2SConnectionConfigurations(p2SConnectionConfigurations); + return this; + } + + public P2SVpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.innerModel().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + + public P2SVpnGatewayImpl withVpnServerConfiguration(SubResource vpnServerConfiguration) { + this.innerModel().withVpnServerConfiguration(vpnServerConfiguration); + return this; + } + + public P2SVpnGatewayImpl withCustomDnsServers(List customDnsServers) { + this.innerModel().withCustomDnsServers(customDnsServers); + return this; + } + + public P2SVpnGatewayImpl withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.innerModel().withIsRoutingPreferenceInternet(isRoutingPreferenceInternet); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java new file mode 100644 index 0000000000000..a5e7177c2520a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java @@ -0,0 +1,2970 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ca49c57a457d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.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.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 Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters, context); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = + this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request, context); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request); + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request, context); + } + + public P2SVpnGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private P2SVpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public P2SVpnGatewayImpl define(String name) { + return new P2SVpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..a7521f857d909 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCaptureQueryStatusResult; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class PacketCaptureQueryStatusResultImpl implements PacketCaptureQueryStatusResult { + private PacketCaptureQueryStatusResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PacketCaptureQueryStatusResultImpl( + PacketCaptureQueryStatusResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime captureStartTime() { + return this.innerModel().captureStartTime(); + } + + public PcStatus packetCaptureStatus() { + return this.innerModel().packetCaptureStatus(); + } + + public String stopReason() { + return this.innerModel().stopReason(); + } + + public List packetCaptureError() { + List inner = this.innerModel().packetCaptureError(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PacketCaptureQueryStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..d78328daf05a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.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.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.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 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..88bcb99536d78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java @@ -0,0 +1,1615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..5453aed7ebc28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + private PacketCapturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..9d9c1793395cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PeerExpressRouteCircuitConnectionImpl implements PeerExpressRouteCircuitConnection { + private PeerExpressRouteCircuitConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerExpressRouteCircuitConnectionImpl( + PeerExpressRouteCircuitConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public SubResource peerExpressRouteCircuitPeering() { + return this.innerModel().peerExpressRouteCircuitPeering(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public String connectionName() { + return this.innerModel().connectionName(); + } + + public String authResourceGuid() { + return this.innerModel().authResourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PeerExpressRouteCircuitConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..bd20e6ee9ee5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..02ff5299e4d9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + private PeerExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java new file mode 100644 index 0000000000000..9e64973f45636 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import java.util.Collections; +import java.util.List; + +public final class PeerRouteListImpl implements PeerRouteList { + private PeerRouteListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerRouteListImpl( + PeerRouteListInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PeerRouteListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java new file mode 100644 index 0000000000000..194f6caac42ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class PrivateDnsZoneGroupImpl implements PrivateDnsZoneGroup { + private PrivateDnsZoneGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateDnsZoneGroupImpl( + PrivateDnsZoneGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateDnsZoneConfigs() { + List inner = this.innerModel().privateDnsZoneConfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateDnsZoneGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java new file mode 100644 index 0000000000000..09d7dccb76114 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java @@ -0,0 +1,1179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..c9014e3718b2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String privateEndpointName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(privateEndpointName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + private PrivateDnsZoneGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ca421a59f9b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkIdentifier() { + return this.innerModel().linkIdentifier(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..9c23347e3e2ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionPropertiesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.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 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..3e40a8482af4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateEndpointName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpoints"); + } + + public PrivateEndpoint refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpoint refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, context) + .getValue(); + return this; + } + + public PrivateEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateEndpointImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateEndpointImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PrivateEndpointImpl withSubnet(SubnetInner subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public PrivateEndpointImpl withPrivateLinkServiceConnections( + List privateLinkServiceConnections) { + this.innerModel().withPrivateLinkServiceConnections(privateLinkServiceConnections); + return this; + } + + public PrivateEndpointImpl withManualPrivateLinkServiceConnections( + List manualPrivateLinkServiceConnections) { + this.innerModel().withManualPrivateLinkServiceConnections(manualPrivateLinkServiceConnections); + return this; + } + + public PrivateEndpointImpl withCustomDnsConfigs(List customDnsConfigs) { + this.innerModel().withCustomDnsConfigs(customDnsConfigs); + return this; + } + + 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..2b5fb1c4ada4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointPropertiesImpl.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.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..e90e71167f36e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java @@ -0,0 +1,1275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call 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..5cbc8ffc6c9f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.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.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 Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PrivateEndpoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, context); + } + + private PrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateEndpointImpl define(String name) { + return new PrivateEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..7d6736c134747 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkServices"); + } + + public PrivateLinkService refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PrivateLinkService refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, context) + .getValue(); + return this; + } + + public PrivateLinkServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateLinkServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateLinkServiceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateLinkServiceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PrivateLinkServiceImpl withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations) { + this.innerModel().withLoadBalancerFrontendIpConfigurations(loadBalancerFrontendIpConfigurations); + return this; + } + + public PrivateLinkServiceImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public PrivateLinkServiceImpl withVisibility(PrivateLinkServicePropertiesVisibility visibility) { + this.innerModel().withVisibility(visibility); + return this; + } + + public PrivateLinkServiceImpl withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval) { + this.innerModel().withAutoApproval(autoApproval); + return this; + } + + public PrivateLinkServiceImpl withFqdns(List fqdns) { + this.innerModel().withFqdns(fqdns); + return this; + } + + public PrivateLinkServiceImpl withEnableProxyProtocol(Boolean enableProxyProtocol) { + this.innerModel().withEnableProxyProtocol(enableProxyProtocol); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java new file mode 100644 index 0000000000000..f92232e4cd5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class PrivateLinkServiceIpConfigurationImpl implements PrivateLinkServiceIpConfiguration { + private PrivateLinkServiceIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateLinkServiceIpConfigurationImpl( + PrivateLinkServiceIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public PrivateLinkServiceIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..66e53518da341 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationPropertiesImpl.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.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..bb86ca2d6ecb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceVisibility; + +public final class PrivateLinkServiceVisibilityImpl implements PrivateLinkServiceVisibility { + private PrivateLinkServiceVisibilityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateLinkServiceVisibilityImpl( + PrivateLinkServiceVisibilityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean visible() { + return this.innerModel().visible(); + } + + public PrivateLinkServiceVisibilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java new file mode 100644 index 0000000000000..a682223ef860e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java @@ -0,0 +1,3445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpointConnection API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpointConnection API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved 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..5b98ffcdc443c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.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.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 Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAutoApprovedPrivateLinkServices(String location) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateLinkService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, context); + } + + private PrivateLinkServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateLinkServiceImpl define(String name) { + return new PrivateLinkServiceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..ec39441800d9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ProbeImpl implements Probe { + private ProbeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ProbeImpl(ProbeInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProbeProtocol protocol() { + return this.innerModel().protocol(); + } + + public int port() { + return this.innerModel().port(); + } + + public Integer intervalInSeconds() { + return this.innerModel().intervalInSeconds(); + } + + 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..f90012a7cd2e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpAddressName = Utils.getValueFromIdByName(innerObject.id(), "publicIPAddresses"); + } + + public PublicIpAddress refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PublicIpAddress refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, context) + .getValue(); + return this; + } + + public 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..979a1851a9118 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressPropertiesFormatImpl.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.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..b15f7e80f391a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java @@ -0,0 +1,3732 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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..32e8cd5e3190d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.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.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 Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServicePublicIpAddresses(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, context); + } + + private PublicIpAddressesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpAddressImpl define(String name) { + return new PublicIpAddressImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..f8da5c15cbff6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpDdosProtectionStatusResultImpl.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.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..b25bcd0b60013 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpPrefixName = Utils.getValueFromIdByName(innerObject.id(), "publicIPPrefixes"); + } + + public PublicIpPrefix refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PublicIpPrefix refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, context) + .getValue(); + return this; + } + + public PublicIpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PublicIpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PublicIpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PublicIpPrefixImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PublicIpPrefixImpl withSku(PublicIpPrefixSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PublicIpPrefixImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public PublicIpPrefixImpl withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.innerModel().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + public PublicIpPrefixImpl withIpTags(List ipTags) { + this.innerModel().withIpTags(ipTags); + return this; + } + + public PublicIpPrefixImpl withPrefixLength(Integer prefixLength) { + this.innerModel().withPrefixLength(prefixLength); + return this; + } + + public PublicIpPrefixImpl withCustomIpPrefix(SubResource customIpPrefix) { + this.innerModel().withCustomIpPrefix(customIpPrefix); + return this; + } + + public PublicIpPrefixImpl withNatGateway(NatGatewayInner natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..e708e2a982ee2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixPropertiesFormatImpl.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.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..9a3ff54374bc0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java @@ -0,0 +1,1453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..270996bf2ee90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PublicIpPrefix getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, context); + } + + private PublicIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpPrefixImpl define(String name) { + return new PublicIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..06febffc72264 --- /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/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..58006e112eaa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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..c67d71e4150c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.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.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..bdd3c4cbbed88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ResourceNavigationLinksListResultImpl implements ResourceNavigationLinksListResult { + private ResourceNavigationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ResourceNavigationLinksListResultImpl( + ResourceNavigationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ResourceNavigationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..fd617bba76b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,3286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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}/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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2022-09-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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2022-09-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = + service + .putBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionShareableLinkListResult.class, + BastionShareableLinkListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2022-09-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2022-09-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + deleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest).block(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + deleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context).block(); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2022-09-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2022-09-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions 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..693a8cf62b60e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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 Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().putBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname, context); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds, context); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public 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..9cadba9fc1eb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeFilterName = Utils.getValueFromIdByName(innerObject.id(), "routeFilters"); + } + + public RouteFilter refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RouteFilter refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteFilters() + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, context) + .getValue(); + return this; + } + + public RouteFilterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RouteFilterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RouteFilterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RouteFilterImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java new file mode 100644 index 0000000000000..470c023862a7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Collections; +import java.util.List; + +public final class RouteFilterRuleImpl implements RouteFilterRule { + private RouteFilterRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + RouteFilterRuleImpl( + RouteFilterRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Access access() { + return this.innerModel().access(); + } + + public RouteFilterRuleType routeFilterRuleType() { + return this.innerModel().routeFilterRuleType(); + } + + public List communities() { + List inner = this.innerModel().communities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RouteFilterRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java new file mode 100644 index 0000000000000..c511f3bb95263 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java @@ -0,0 +1,1156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilterRules API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilterRules API service call 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..2264b82dda3a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context) { + PagedIterable inner = + this.serviceClient().listByRouteFilter(resourceGroupName, routeFilterName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + private RouteFilterRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java new file mode 100644 index 0000000000000..c9ea21d52e56e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java @@ -0,0 +1,1455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..b18cdfe83bf79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.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.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 Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public RouteFilter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, context); + } + + private RouteFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteFilterImpl define(String name) { + return new RouteFilterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java new file mode 100644 index 0000000000000..bd6ed8611e41f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "routeTables"); + this.routeName = Utils.getValueFromIdByName(innerObject.id(), "routes"); + } + + public Route refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE) + .getValue(); + return this; + } + + public Route refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, context) + .getValue(); + return this; + } + + public RouteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public RouteImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public RouteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.innerModel().withNextHopType(nextHopType); + return this; + } + + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.innerModel().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + public RouteImpl withHasBgpOverride(Boolean hasBgpOverride) { + this.innerModel().withHasBgpOverride(hasBgpOverride); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..806f81e5a5ecd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeMapName = Utils.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..18692d83f5b9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..515f7074317e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.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 Utils.mapPage(inner, inner1 -> new RouteMapImpl(inner1, this.manager())); + } + + public RouteMap getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeMapName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeMapName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeMapName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeMapName = Utils.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..32032493e46c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "routeTables"); + } + + public RouteTable refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RouteTable refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRouteTables() + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, context) + .getValue(); + return this; + } + + public RouteTableImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RouteTableImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RouteTableImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RouteTableImpl withRoutes(List routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.innerModel().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java new file mode 100644 index 0000000000000..0cabd81be74e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java @@ -0,0 +1,1439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteTable API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteTable API service call 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..cc5c5388788f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.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.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 Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public RouteTable getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, context); + } + + private RouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteTableImpl define(String name) { + return new RouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java new file mode 100644 index 0000000000000..07fff1bc1797a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..91e57048d689e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName, context); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Route getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, context); + } + + private RoutesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteImpl define(String name) { + return new RouteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..1366112667739 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routingIntentName = Utils.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..6ab12e1494006 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java @@ -0,0 +1,1162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..b11c9b3bfce85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.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 Utils.mapPage(inner, inner1 -> new RoutingIntentImpl(inner1, this.manager())); + } + + public RoutingIntent getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routingIntentName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routingIntentName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routingIntentName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routingIntentName = Utils.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/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..6da996887cbc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.scopeConnectionName = Utils.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..56b44e6ee3121 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsClientImpl.java @@ -0,0 +1,971 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..bb2e76700517c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new ScopeConnectionImpl(inner1, this.manager())); + } + + public ScopeConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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..515f55387076a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = Utils.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..6cc641fb8b29e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsClientImpl.java @@ -0,0 +1,1159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of 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..04ddea9e79791 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.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 Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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..19f94157c86a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import java.util.Collections; +import java.util.List; + +public final class SecurityGroupViewResultImpl implements SecurityGroupViewResult { + private SecurityGroupViewResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SecurityGroupViewResultImpl( + SecurityGroupViewResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityGroupViewResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java new file mode 100644 index 0000000000000..419876d6cab2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityPartnerProviderName = Utils.getValueFromIdByName(innerObject.id(), "securityPartnerProviders"); + } + + public SecurityPartnerProvider refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, Context.NONE) + .getValue(); + return this; + } + + public SecurityPartnerProvider refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPartnerProviders() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context) + .getValue(); + return this; + } + + public SecurityPartnerProviderImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecurityPartnerProviderImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecurityPartnerProviderImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SecurityPartnerProviderImpl withSecurityProviderName(SecurityProviderName securityProviderName) { + this.innerModel().withSecurityProviderName(securityProviderName); + return this; + } + + public SecurityPartnerProviderImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java new file mode 100644 index 0000000000000..97c409ed2a835 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java @@ -0,0 +1,1498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..a24180256df3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.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.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 Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public SecurityPartnerProvider getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, context); + } + + private SecurityPartnerProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityPartnerProviderImpl define(String name) { + return new SecurityPartnerProviderImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java new file mode 100644 index 0000000000000..4dda8f0f98c77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SecurityRuleImpl implements SecurityRule, SecurityRule.Definition, SecurityRule.Update { + private SecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public SecurityRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public String sourcePortRange() { + return this.innerModel().sourcePortRange(); + } + + public String destinationPortRange() { + return this.innerModel().destinationPortRange(); + } + + public String sourceAddressPrefix() { + return this.innerModel().sourceAddressPrefix(); + } + + public List sourceAddressPrefixes() { + List inner = this.innerModel().sourceAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sourceApplicationSecurityGroups() { + List inner = this.innerModel().sourceApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String destinationAddressPrefix() { + return this.innerModel().destinationAddressPrefix(); + } + + public List destinationAddressPrefixes() { + List inner = this.innerModel().destinationAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationApplicationSecurityGroups() { + List inner = this.innerModel().destinationApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List sourcePortRanges() { + List inner = this.innerModel().sourcePortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationPortRanges() { + List inner = this.innerModel().destinationPortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityRuleAccess access() { + return this.innerModel().access(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public SecurityRuleDirection direction() { + return this.innerModel().direction(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + this.securityRuleName = Utils.getValueFromIdByName(innerObject.id(), "securityRules"); + } + + public SecurityRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE) + .getValue(); + return this; + } + + public SecurityRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context) + .getValue(); + return this; + } + + public SecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SecurityRuleImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SecurityRuleImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public SecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.innerModel().withSourcePortRange(sourcePortRange); + return this; + } + + public SecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.innerModel().withDestinationPortRange(destinationPortRange); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.innerModel().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.innerModel().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + public SecurityRuleImpl withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups) { + this.innerModel().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.innerModel().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.innerModel().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + public SecurityRuleImpl withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups) { + this.innerModel().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public SecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public SecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.innerModel().withAccess(access); + return this; + } + + public SecurityRuleImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public SecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.innerModel().withDirection(direction); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java new file mode 100644 index 0000000000000..c28e1a3330cf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..df908128b8d93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + private SecurityRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityRuleImpl define(String name) { + return new SecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java new file mode 100644 index 0000000000000..f46cb9ede45b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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..4a2ad34763041 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.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.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..170b0a048509b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ServiceAssociationLinksListResultImpl implements ServiceAssociationLinksListResult { + private ServiceAssociationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceAssociationLinksListResultImpl( + ServiceAssociationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ServiceAssociationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java new file mode 100644 index 0000000000000..2659fbd57dad9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java @@ -0,0 +1,1501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..cf9928ca5e582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.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.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 Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, context); + } + + private ServiceEndpointPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ServiceEndpointPolicyImpl define(String name) { + return new ServiceEndpointPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..1356b4d8a480e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceEndpointPolicyName = Utils.getValueFromIdByName(innerObject.id(), "serviceEndpointPolicies"); + this.serviceEndpointPolicyDefinitionName = + Utils.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..9ed226f4cae81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java @@ -0,0 +1,1301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..0ef9400f86576 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.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.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 Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicyDefinition getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String serviceEndpointPolicyDefinitionName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String serviceEndpointPolicyDefinitionName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String serviceEndpointPolicyDefinitionName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String serviceEndpointPolicyDefinitionName = Utils.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..8812a80005a4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceEndpointPolicyName = Utils.getValueFromIdByName(innerObject.id(), "serviceEndpointPolicies"); + } + + public ServiceEndpointPolicy refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public ServiceEndpointPolicy refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getServiceEndpointPolicies() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, context) + .getValue(); + return this; + } + + public ServiceEndpointPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServiceEndpointPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServiceEndpointPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ServiceEndpointPolicyImpl withServiceEndpointPolicyDefinitions( + List serviceEndpointPolicyDefinitions) { + this.innerModel().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + + 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..06453003fb8c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationImpl.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.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..d724f2ceb5a44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsClientImpl.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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..44bfd51bb7db2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.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.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 Utils.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 Utils.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..f134a187cfc4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.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.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 = "2022-09-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 = "2022-09-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..1800e1fae0f5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.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.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..150b088f7cd41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.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.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..d99847233cef1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignatureOverridesFilterValuesResponseImpl.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.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..9ea1a95b0a5fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesImpl.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.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..f2878c3863345 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesListImpl.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.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..1ca9509a5f7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMemberImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = Utils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.networkGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkGroups"); + this.staticMemberName = Utils.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..953332dc28cc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersClientImpl.java @@ -0,0 +1,1089 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list 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..bfb6ad13fd19a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 Utils.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 Utils.mapPage(inner, inner1 -> new StaticMemberImpl(inner1, this.manager())); + } + + public StaticMember getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "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 = Utils.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 = Utils.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 = Utils.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..ecb0e48ea3f9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.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.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SubnetImpl implements Subnet, Subnet.Definition, Subnet.Update { + private SubnetInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public List addressPrefixes() { + List inner = this.innerModel().addressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.innerModel().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public RouteTable routeTable() { + RouteTableInner inner = this.innerModel().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource natGateway() { + return this.innerModel().natGateway(); + } + + public List serviceEndpoints() { + List inner = this.innerModel().serviceEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceEndpointPolicies() { + List inner = this.innerModel().serviceEndpointPolicies(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpoints() { + List inner = this.innerModel().privateEndpoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurationProfiles() { + List inner = this.innerModel().ipConfigurationProfiles(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationProfileImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipAllocations() { + List inner = this.innerModel().ipAllocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List resourceNavigationLinks() { + List inner = this.innerModel().resourceNavigationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceAssociationLinks() { + List inner = this.innerModel().serviceAssociationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List delegations() { + List inner = this.innerModel().delegations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String purpose() { + return this.innerModel().purpose(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies() { + return this.innerModel().privateEndpointNetworkPolicies(); + } + + public VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies() { + return this.innerModel().privateLinkServiceNetworkPolicies(); + } + + public List applicationGatewayIpConfigurations() { + List inner = this.innerModel().applicationGatewayIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.subnetName = Utils.getValueFromIdByName(innerObject.id(), "subnets"); + } + + public Subnet refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public Subnet refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, context) + .getValue(); + return this; + } + + public void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + } + + public void prepareNetworkPolicies( + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + } + + public void unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + } + + public void unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + } + + public SubnetImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SubnetImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public SubnetImpl withAddressPrefixes(List addressPrefixes) { + this.innerModel().withAddressPrefixes(addressPrefixes); + return this; + } + + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.innerModel().withRouteTable(routeTable); + return this; + } + + public SubnetImpl withNatGateway(SubResource natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.innerModel().withServiceEndpoints(serviceEndpoints); + return this; + } + + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.innerModel().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + public SubnetImpl withIpAllocations(List ipAllocations) { + this.innerModel().withIpAllocations(ipAllocations); + return this; + } + + public SubnetImpl withDelegations(List delegations) { + this.innerModel().withDelegations(delegations); + return this; + } + + public SubnetImpl withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies) { + this.innerModel().withPrivateEndpointNetworkPolicies(privateEndpointNetworkPolicies); + return this; + } + + public SubnetImpl withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies) { + this.innerModel().withPrivateLinkServiceNetworkPolicies(privateLinkServiceNetworkPolicies); + return this; + } + + public SubnetImpl withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations) { + this.innerModel().withApplicationGatewayIpConfigurations(applicationGatewayIpConfigurations); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..ff25217566ef0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetPropertiesFormatImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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.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 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..d86f93309701c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java @@ -0,0 +1,1870 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..7c2971087dfd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.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.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 Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public Subnet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + private SubnetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SubnetImpl define(String name) { + return new SubnetImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..dea2e3d16311e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsClientImpl.java @@ -0,0 +1,821 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..b5784f06c319b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new NetworkManagerConnectionImpl(inner1, this.manager())); + } + + public NetworkManagerConnection getById(String id) { + String networkManagerConnectionName = Utils.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 = Utils.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 = Utils.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 = Utils.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..3f4a3e38703eb --- /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..18597c0c66b95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceListResultImpl.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.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..2a88ed09cbf7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TroubleshootingResultImpl implements TroubleshootingResult { + private TroubleshootingResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + TroubleshootingResultImpl( + TroubleshootingResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public String code() { + return this.innerModel().code(); + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TroubleshootingResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..4ecca678e41e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.Usage; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public long currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..a037f4a73caf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.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.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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the 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..7b88e572c8421 --- /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 Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java new file mode 100644 index 0000000000000..64d0a08514764 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java new file mode 100644 index 0000000000000..53cdfa059d67b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; + +public final class VerificationIpFlowResultImpl implements VerificationIpFlowResult { + private VerificationIpFlowResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VerificationIpFlowResultImpl( + VerificationIpFlowResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Access access() { + return this.innerModel().access(); + } + + public String ruleName() { + return this.innerModel().ruleName(); + } + + public VerificationIpFlowResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..2ed2446ce9758 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsClientImpl.java @@ -0,0 +1,679 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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..b2eaa61e3607d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsImpl.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.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..758c6aeb24282 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.siteName = Utils.getValueFromIdByName(innerObject.id(), "virtualApplianceSites"); + } + + public VirtualApplianceSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE) + .getValue(); + return this; + } + + public VirtualApplianceSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context) + .getValue(); + return this; + } + + public VirtualApplianceSiteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualApplianceSiteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public VirtualApplianceSiteImpl withO365Policy(Office365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java new file mode 100644 index 0000000000000..fb1aaf2cbcf8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..f1a2df1515d32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkVirtualApplianceName, context); + return Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public VirtualApplianceSite getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + private VirtualApplianceSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualApplianceSiteImpl define(String name) { + return new VirtualApplianceSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java new file mode 100644 index 0000000000000..9c0c24ce52498 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..675312165b312 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.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.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 Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public 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..80f5507531977 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java @@ -0,0 +1,1680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubBgpConnectionResults; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubBgpConnectionsClient. */ +public final class VirtualHubBgpConnectionsClientImpl implements VirtualHubBgpConnectionsClient { + /** 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 list of virtual router 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 = "2022-09-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 = "2022-09-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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PeerRouteListInner> beginListLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + Mono>> mono = + listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PeerRouteListInner.class, + PeerRouteListInner.class, + 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PeerRouteListInner> beginListLearnedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> 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 list of virtual router 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 list of virtual router 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + return listLearnedRoutesAsync(resourceGroupName, hubName, connectionName).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return listLearnedRoutesAsync(resourceGroupName, hubName, connectionName, context).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 = "2022-09-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 = "2022-09-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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PeerRouteListInner> beginListAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName) { + Mono>> mono = + listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PeerRouteListInner.class, + PeerRouteListInner.class, + 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PeerRouteListInner> beginListAdvertisedRoutesAsync( + String resourceGroupName, String hubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PeerRouteListInner.class, PeerRouteListInner.class, context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> 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 list of virtual router 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 list of virtual router 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 list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + return listAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).block(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerRouteListInner listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return listAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list 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..6cf4da6154566 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.BgpConnection; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; + +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 Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, context); + } + + private VirtualHubBgpConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BgpConnectionImpl define(String name) { + return new BgpConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..53691749cc40b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + } + + public VirtualHub refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE) + .getValue(); + return this; + } + + public VirtualHub refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context) + .getValue(); + return this; + } + + public void getEffectiveVirtualHubRoutes() { + serviceManager.virtualHubs().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + serviceManager + .virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public void getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters) { + serviceManager.virtualHubs().getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters); + } + + public void getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + serviceManager + .virtualHubs() + .getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters, context); + } + + public void getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters) { + serviceManager.virtualHubs().getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + } + + public void getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + 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..37e0861267f3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java @@ -0,0 +1,1140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..bdab0d9e3b397 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.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.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 Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public HubIpConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, context); + } + + private VirtualHubIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubIpConfigurationImpl define(String name) { + return new HubIpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java new file mode 100644 index 0000000000000..8c062ebf18af4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.util.Collections; +import java.util.List; + +public final class VirtualHubRouteTableV2Impl implements VirtualHubRouteTableV2 { + private VirtualHubRouteTableV2Inner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualHubRouteTableV2Impl( + VirtualHubRouteTableV2Inner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List attachedConnections() { + List inner = this.innerModel().attachedConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualHubRouteTableV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java new file mode 100644 index 0000000000000..b3c5638c36dbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java @@ -0,0 +1,1164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..f169043d89be0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + private VirtualHubRouteTableV2SClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java new file mode 100644 index 0000000000000..2c6b7c0154855 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java @@ -0,0 +1,2414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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, Void> beginGetEffectiveVirtualHubRoutesAsync( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + Mono>> mono = + getEffectiveVirtualHubRoutesWithResponseAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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, Void> beginGetEffectiveVirtualHubRoutesAsync( + String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + Mono>> mono = + getEffectiveVirtualHubRoutesWithResponseAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.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, Void> beginGetEffectiveVirtualHubRoutesAsync( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getEffectiveVirtualHubRoutesWithResponseAsync( + resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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, Void> 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, Void> 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).block(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .block(); + } + + /** + * 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 = "2022-09-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 = "2022-09-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, Void> beginGetInboundRoutesAsync( + String resourceGroupName, String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) { + Mono>> mono = + getInboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.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, Void> 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(), Void.class, Void.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, Void> 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, Void> 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getInboundRoutes( + String resourceGroupName, String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) { + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getInboundRoutes( + String resourceGroupName, + String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, + Context context) { + 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 = "2022-09-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 = "2022-09-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, Void> beginGetOutboundRoutesAsync( + String resourceGroupName, String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) { + Mono>> mono = + getOutboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.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, Void> 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(), Void.class, Void.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, Void> 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, Void> 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getOutboundRoutes( + String resourceGroupName, String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) { + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getOutboundRoutes( + String resourceGroupName, + String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, + Context context) { + getOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..ea9fb25fc551b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +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 Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + this + .serviceClient() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public void getInboundRoutes( + String resourceGroupName, String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) { + this.serviceClient().getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters); + } + + public void getInboundRoutes( + String resourceGroupName, + String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, + Context context) { + this.serviceClient().getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters, context); + } + + public void getOutboundRoutes( + String resourceGroupName, String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) { + this.serviceClient().getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + } + + public void getOutboundRoutes( + String resourceGroupName, + String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, + Context context) { + this.serviceClient().getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context); + } + + public VirtualHub getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, context); + } + + private VirtualHubsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualHubImpl define(String name) { + return new VirtualHubImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..f2fcd2396fb0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public VirtualNetworkGatewayConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .getValue(); + return this; + } + + public String startPacketCapture() { + 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..e869e7d0cc7a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.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.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..1ab2ca3ed08a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java @@ -0,0 +1,3505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..0db63b0b5fea5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + ConnectionResetSharedKeyInner inner = + this.serviceClient().resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + ConnectionResetSharedKeyInner inner = + this + .serviceClient() + .resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public VirtualNetworkGatewayConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + private VirtualNetworkGatewayConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayConnectionImpl define(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..c515035c6bda3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.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 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 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + } + + public VirtualNetworkGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context) + .getValue(); + return this; + } + + public VirtualNetworkGateway reset() { + 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 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; + } + + 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..73428290965c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VirtualNetworkGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java new file mode 100644 index 0000000000000..b66296b4ff1d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java @@ -0,0 +1,1203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway 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..0914415cb4d93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVirtualNetworkGateway(resourceGroupName, virtualNetworkGatewayName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public VirtualNetworkGatewayNatRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + private VirtualNetworkGatewayNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayNatRuleImpl define(String name) { + return new VirtualNetworkGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java new file mode 100644 index 0000000000000..4daa86307eb63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java @@ -0,0 +1,6326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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< + PollResult, 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< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealthAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getVpnclientConnectionHealthWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + VpnClientConnectionHealthDetailListResultInner.class, + VpnClientConnectionHealthDetailListResultInner.class, + context); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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< + PollResult, 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< + PollResult, 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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the VirtualNetworkGatewayListConnections API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the VirtualNetworkGatewayListConnections API service call 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..8f5ee41fa496c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName) { + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, context); + } + + private VirtualNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayImpl define(String name) { + return new VirtualNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..81c009c88c0e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.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.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + } + + public VirtualNetwork refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetwork refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, context) + .getValue(); + return this; + } + + public 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; + } + + 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..f00a9a5026b0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.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.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; + +public final class VirtualNetworkPeeringImpl + implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private VirtualNetworkPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean allowVirtualNetworkAccess() { + return this.innerModel().allowVirtualNetworkAccess(); + } + + public Boolean allowForwardedTraffic() { + return this.innerModel().allowForwardedTraffic(); + } + + public Boolean allowGatewayTransit() { + return this.innerModel().allowGatewayTransit(); + } + + public Boolean useRemoteGateways() { + return this.innerModel().useRemoteGateways(); + } + + public SubResource remoteVirtualNetwork() { + return this.innerModel().remoteVirtualNetwork(); + } + + public AddressSpace remoteAddressSpace() { + return this.innerModel().remoteAddressSpace(); + } + + public AddressSpace remoteVirtualNetworkAddressSpace() { + return this.innerModel().remoteVirtualNetworkAddressSpace(); + } + + public VirtualNetworkBgpCommunities remoteBgpCommunities() { + return this.innerModel().remoteBgpCommunities(); + } + + public 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkPeerings"); + } + + public VirtualNetworkPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkPeerings() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) + .getValue(); + return this; + } + + public VirtualNetworkPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualNetworkPeeringImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.innerModel().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.innerModel().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.innerModel().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.innerModel().withUseRemoteGateways(useRemoteGateways); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.innerModel().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.innerModel().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteVirtualNetworkAddressSpace( + AddressSpace remoteVirtualNetworkAddressSpace) { + this.innerModel().withRemoteVirtualNetworkAddressSpace(remoteVirtualNetworkAddressSpace); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities) { + this.innerModel().withRemoteBgpCommunities(remoteBgpCommunities); + return this; + } + + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.innerModel().withPeeringState(peeringState); + return this; + } + + public VirtualNetworkPeeringImpl withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel) { + this.innerModel().withPeeringSyncLevel(peeringSyncLevel); + return this; + } + + public VirtualNetworkPeeringImpl withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways) { + this.innerModel().withDoNotVerifyRemoteGateways(doNotVerifyRemoteGateways); + return this; + } + + public VirtualNetworkPeeringImpl withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace) { + if (isInCreateMode()) { + this.createSyncRemoteAddressSpace = syncRemoteAddressSpace; + return this; + } else { + this.updateSyncRemoteAddressSpace = syncRemoteAddressSpace; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java new file mode 100644 index 0000000000000..c3159d9f647ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java @@ -0,0 +1,1339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..56a4a065b7ff1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public VirtualNetworkPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + private VirtualNetworkPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkPeeringImpl define(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java new file mode 100644 index 0000000000000..f98f0d8ee35ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.tapName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkTaps"); + } + + public VirtualNetworkTap refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .getByResourceGroupWithResponse(resourceGroupName, tapName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkTap refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkTaps() + .getByResourceGroupWithResponse(resourceGroupName, tapName, context) + .getValue(); + return this; + } + + public VirtualNetworkTapImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkTapImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkTapImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTapParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkTapImpl withDestinationNetworkInterfaceIpConfiguration( + NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration) { + this.innerModel().withDestinationNetworkInterfaceIpConfiguration(destinationNetworkInterfaceIpConfiguration); + return this; + } + + public VirtualNetworkTapImpl withDestinationLoadBalancerFrontEndIpConfiguration( + FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration) { + this + .innerModel() + .withDestinationLoadBalancerFrontEndIpConfiguration(destinationLoadBalancerFrontEndIpConfiguration); + return this; + } + + public VirtualNetworkTapImpl withDestinationPort(Integer destinationPort) { + this.innerModel().withDestinationPort(destinationPort); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..089ba116da1c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapPropertiesFormatImpl.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.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..438e38e5bb71e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java @@ -0,0 +1,1437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..822cf13afa97e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public VirtualNetworkTap getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, context); + } + + private VirtualNetworkTapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkTapImpl define(String name) { + return new VirtualNetworkTapImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..8f914ecd9a315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; + +public final class VirtualNetworkUsageImpl implements VirtualNetworkUsage { + private VirtualNetworkUsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkUsageImpl( + VirtualNetworkUsageInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String id() { + return this.innerModel().id(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public VirtualNetworkUsageName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public VirtualNetworkUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java new file mode 100644 index 0000000000000..e7abfd8271d4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java @@ -0,0 +1,2298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for 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..af46e51eab333 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public 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 Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listUsage(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public PagedIterable listDdosProtectionStatus( + String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().listDdosProtectionStatus(resourceGroupName, virtualNetworkName); + return Utils.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 Utils.mapPage(inner, inner1 -> new PublicIpDdosProtectionStatusResultImpl(inner1, this.manager())); + } + + public VirtualNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, context); + } + + private VirtualNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkImpl define(String name) { + return new VirtualNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java new file mode 100644 index 0000000000000..2c2a35ed76871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + } + + public VirtualRouter refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouter refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, context) + .getValue(); + return this; + } + + public VirtualRouterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualRouterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualRouterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public VirtualRouterImpl withVirtualRouterAsn(Long virtualRouterAsn) { + this.innerModel().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + public VirtualRouterImpl withVirtualRouterIps(List virtualRouterIps) { + this.innerModel().withVirtualRouterIps(virtualRouterIps); + return this; + } + + public VirtualRouterImpl withHostedSubnet(SubResource hostedSubnet) { + this.innerModel().withHostedSubnet(hostedSubnet); + return this; + } + + public VirtualRouterImpl withHostedGateway(SubResource hostedGateway) { + this.innerModel().withHostedGateway(hostedGateway); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java new file mode 100644 index 0000000000000..51ffe41f9a733 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public VirtualRouterPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouterPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, context) + .getValue(); + return this; + } + + public VirtualRouterPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualRouterPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public VirtualRouterPeeringImpl withPeerIp(String peerIp) { + this.innerModel().withPeerIp(peerIp); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java new file mode 100644 index 0000000000000..e4f42ed3eb522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java @@ -0,0 +1,1139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..c160e176495a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualRouterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualRouterName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public VirtualRouterPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, context); + } + + private VirtualRouterPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterPeeringImpl define(String name) { + return new VirtualRouterPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java new file mode 100644 index 0000000000000..789e3cb06221f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java @@ -0,0 +1,1270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..a64b02a776cc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public VirtualRouter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, context); + } + + private VirtualRoutersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterImpl define(String name) { + return new VirtualRouterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java new file mode 100644 index 0000000000000..2002eee49a87b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualWanName = Utils.getValueFromIdByName(innerObject.id(), "virtualWans"); + } + + public VirtualWan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .getByResourceGroupWithResponse(resourceGroupName, virtualWanName, Context.NONE) + .getValue(); + return this; + } + + public VirtualWan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualWans() + .getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context) + .getValue(); + return this; + } + + public VirtualWanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualWanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualWanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateWanParameters.withTags(tags); + return this; + } + } + + public VirtualWanImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.innerModel().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + public VirtualWanImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.innerModel().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + public VirtualWanImpl withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.innerModel().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); + return this; + } + + public VirtualWanImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java new file mode 100644 index 0000000000000..aa1dc98be22a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProviders; +import java.util.Collections; +import java.util.List; + +public final class VirtualWanSecurityProvidersImpl implements VirtualWanSecurityProviders { + private VirtualWanSecurityProvidersInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualWanSecurityProvidersImpl( + VirtualWanSecurityProvidersInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedProviders() { + List inner = this.innerModel().supportedProviders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualWanSecurityProvidersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java new file mode 100644 index 0000000000000..b1b2263ebb460 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java @@ -0,0 +1,1435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..653bcea905fe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.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.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 Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public VirtualWan getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, context); + } + + private VirtualWansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualWanImpl define(String name) { + return new VirtualWanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java new file mode 100644 index 0000000000000..7b4dad39cf768 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import java.util.Collections; +import java.util.List; + +public final class VpnClientConnectionHealthDetailListResultImpl implements VpnClientConnectionHealthDetailListResult { + private VpnClientConnectionHealthDetailListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientConnectionHealthDetailListResultImpl( + VpnClientConnectionHealthDetailListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnClientConnectionHealthDetailListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..adf02429e54fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; + +public final class VpnClientIPsecParametersImpl implements VpnClientIPsecParameters { + private VpnClientIPsecParametersInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientIPsecParametersImpl( + VpnClientIPsecParametersInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int saLifeTimeSeconds() { + return this.innerModel().saLifeTimeSeconds(); + } + + public int saDataSizeKilobytes() { + return this.innerModel().saDataSizeKilobytes(); + } + + public IpsecEncryption ipsecEncryption() { + return this.innerModel().ipsecEncryption(); + } + + public IpsecIntegrity ipsecIntegrity() { + return this.innerModel().ipsecIntegrity(); + } + + public IkeEncryption ikeEncryption() { + return this.innerModel().ikeEncryption(); + } + + public IkeIntegrity ikeIntegrity() { + return this.innerModel().ikeIntegrity(); + } + + public DhGroup dhGroup() { + return this.innerModel().dhGroup(); + } + + public PfsGroup pfsGroup() { + return this.innerModel().pfsGroup(); + } + + public VpnClientIPsecParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..1a364be203cff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VpnConnectionImpl implements VpnConnection { + private VpnConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnConnectionImpl( + VpnConnectionInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVpnSite() { + return this.innerModel().remoteVpnSite(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Integer dpdTimeoutSeconds() { + return this.innerModel().dpdTimeoutSeconds(); + } + + public VpnConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerModel().vpnConnectionProtocolType(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Integer connectionBandwidth() { + return this.innerModel().connectionBandwidth(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trafficSelectorPolicies() { + List inner = this.innerModel().trafficSelectorPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableRateLimiting() { + return this.innerModel().enableRateLimiting(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List vpnLinkConnections() { + List inner = this.innerModel().vpnLinkConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public VpnConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java new file mode 100644 index 0000000000000..beaa7340ef1ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java @@ -0,0 +1,1904 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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..817fcabcb5fc1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + private VpnConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..9a933074651d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + } + + public VpnGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public VpnGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, context) + .getValue(); + return this; + } + + public VpnGateway reset() { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName); + } + + public VpnGateway reset(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..2e4125a845f65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VpnGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VpnGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VpnGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VpnGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VpnGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VpnGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java new file mode 100644 index 0000000000000..e04afe4a200f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java @@ -0,0 +1,2524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..bc741d8fc6305 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public VpnGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private VpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayImpl define(String name) { + return new VpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java new file mode 100644 index 0000000000000..3280c16503baf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java @@ -0,0 +1,1014 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSiteLinkConnectionsResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnLinkConnectionsClient. */ +public final class VpnLinkConnectionsClientImpl implements VpnLinkConnectionsClient { + /** 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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getIkeSas( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnectionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2022-09-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 = "2022-09-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 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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..379cd82f71d2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.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.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; + +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 String getIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName); + } + + public String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return this + .serviceClient() + .getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + private VpnLinkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java new file mode 100644 index 0000000000000..f72d4f53d11de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; + +public final class VpnProfileResponseImpl implements VpnProfileResponse { + private VpnProfileResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnProfileResponseImpl( + VpnProfileResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String profileUrl() { + return this.innerModel().profileUrl(); + } + + public VpnProfileResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java new file mode 100644 index 0000000000000..37374f1ccd0cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "vpnServerConfigurations"); + } + + public VpnServerConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context) + .getValue(); + return this; + } + + public VpnServerConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnServerConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnServerConfigurationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnServerConfigurationParameters.withTags(tags); + return this; + } + } + + public VpnServerConfigurationImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public VpnServerConfigurationImpl withVpnProtocols(List vpnProtocols) { + this.innerModel().withVpnProtocols(vpnProtocols); + return this; + } + + public VpnServerConfigurationImpl withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.innerModel().withVpnAuthenticationTypes(vpnAuthenticationTypes); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.innerModel().withVpnClientRootCertificates(vpnClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.innerModel().withVpnClientRevokedCertificates(vpnClientRevokedCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerRootCertificates( + List radiusServerRootCertificates) { + this.innerModel().withRadiusServerRootCertificates(radiusServerRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusClientRootCertificates( + List radiusClientRootCertificates) { + this.innerModel().withRadiusClientRootCertificates(radiusClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.innerModel().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerAddress(String radiusServerAddress) { + this.innerModel().withRadiusServerAddress(radiusServerAddress); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerSecret(String radiusServerSecret) { + this.innerModel().withRadiusServerSecret(radiusServerSecret); + return this; + } + + public VpnServerConfigurationImpl withRadiusServers(List radiusServers) { + this.innerModel().withRadiusServers(radiusServers); + return this; + } + + public VpnServerConfigurationImpl withAadAuthenticationParameters( + AadAuthenticationParameters aadAuthenticationParameters) { + this.innerModel().withAadAuthenticationParameters(aadAuthenticationParameters); + return this; + } + + 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..5b08530c6e812 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationPolicyGroupImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "vpnServerConfigurations"); + this.configurationPolicyGroupName = Utils.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..7d546920a7d97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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 = "2022-09-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 = "2022-09-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..d2b4270891207 --- /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..1ad2f6592ce40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java @@ -0,0 +1,1533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..92ef27766b75b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public VpnServerConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, context); + } + + private VpnServerConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnServerConfigurationImpl define(String name) { + return new VpnServerConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java new file mode 100644 index 0000000000000..0e4c654761afa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsResponse; +import java.util.Collections; +import java.util.List; + +public final class VpnServerConfigurationsResponseImpl implements VpnServerConfigurationsResponse { + private VpnServerConfigurationsResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnServerConfigurationsResponseImpl( + VpnServerConfigurationsResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List vpnServerConfigurationResourceIds() { + List inner = this.innerModel().vpnServerConfigurationResourceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnServerConfigurationsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..ab4afebdcf36e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.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.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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnSiteName = Utils.getValueFromIdByName(innerObject.id(), "vpnSites"); + } + + public VpnSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE) + .getValue(); + return this; + } + + public VpnSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context) + .getValue(); + return this; + } + + public VpnSiteImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnSiteImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnSiteImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnSiteParameters.withTags(tags); + return this; + } + } + + public VpnSiteImpl withVirtualWan(SubResource virtualWan) { + this.innerModel().withVirtualWan(virtualWan); + return this; + } + + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.innerModel().withDeviceProperties(deviceProperties); + return this; + } + + public VpnSiteImpl withIpAddress(String ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public VpnSiteImpl withSiteKey(String siteKey) { + this.innerModel().withSiteKey(siteKey); + return this; + } + + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.innerModel().withAddressSpace(addressSpace); + return this; + } + + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.innerModel().withBgpProperties(bgpProperties); + return this; + } + + public VpnSiteImpl withIsSecuritySite(Boolean isSecuritySite) { + this.innerModel().withIsSecuritySite(isSecuritySite); + return this; + } + + public VpnSiteImpl withVpnSiteLinks(List vpnSiteLinks) { + this.innerModel().withVpnSiteLinks(vpnSiteLinks); + return this; + } + + public VpnSiteImpl withO365Policy(O365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java new file mode 100644 index 0000000000000..17faf2b3380db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.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.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 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..6d6fc118ec8bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.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 = "2022-09-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 = "2022-09-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..2e94747bea24b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.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.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..ec8629f491cb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; + +public final class VpnSiteLinkImpl implements VpnSiteLink { + private VpnSiteLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnSiteLinkImpl( + VpnSiteLinkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VpnLinkProviderProperties linkProperties() { + return this.innerModel().linkProperties(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public VpnLinkBgpSettings bgpProperties() { + return this.innerModel().bgpProperties(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnSiteLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java new file mode 100644 index 0000000000000..30ba6f18c455e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks 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..e6c2e08e765da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + private VpnSiteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java new file mode 100644 index 0000000000000..93ae6a7e0c5a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java @@ -0,0 +1,1430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..362099a28c633 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 = "2022-09-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 = "2022-09-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..8f45c2f263876 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.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.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..c1d93f54815cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.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.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 Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public VpnSite getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, context); + } + + private VpnSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnSiteImpl define(String name) { + return new VpnSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..0f23c04415291 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java @@ -0,0 +1,1164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies 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..fc61ab5120925 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.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.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 Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, context); + } + + private WebApplicationFirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public WebApplicationFirewallPolicyImpl define(String name) { + return new WebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..34e3f460363f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.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.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicy; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class WebApplicationFirewallPolicyImpl + implements WebApplicationFirewallPolicy, + WebApplicationFirewallPolicy.Definition, + WebApplicationFirewallPolicy.Update { + private WebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = + Utils.getValueFromIdByName(innerObject.id(), "ApplicationGatewayWebApplicationFirewallPolicies"); + } + + public WebApplicationFirewallPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebApplicationFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WebApplicationFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WebApplicationFirewallPolicyImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public WebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.innerModel().withPolicySettings(policySettings); + return this; + } + + public WebApplicationFirewallPolicyImpl withCustomRules(List customRules) { + this.innerModel().withCustomRules(customRules); + return this; + } + + public WebApplicationFirewallPolicyImpl withManagedRules(ManagedRulesDefinition managedRules) { + this.innerModel().withManagedRules(managedRules); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java new file mode 100644 index 0000000000000..fa5f0e4571bc3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.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.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 = "2022-09-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 = "2022-09-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 = "2022-09-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 = "2022-09-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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureWebCategories API service call 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureWebCategories API service call 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..a0820ea43ae63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.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.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 Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + private WebCategoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java new file mode 100644 index 0000000000000..1af957c3ce12b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.implementation; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java new file mode 100644 index 0000000000000..0db42255af8c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AAD Vpn authentication type related parameters. */ +@Fluent +public final class AadAuthenticationParameters { + /* + * AAD Vpn authentication parameter AAD tenant. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * AAD Vpn authentication parameter AAD audience. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * AAD Vpn authentication parameter AAD issuer. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /** 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() { + } +} 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..e7fa812e25049 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..655edbcac0e55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Action.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Action to be taken on a route matching a RouteMap criterion. */ +@Fluent +public final class Action { + /* + * Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.' + */ + @JsonProperty(value = "type") + 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 + */ + @JsonProperty(value = "parameters") + 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()); + } + } +} 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..e2f79bcf4767e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines 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"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/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..825a7207609cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveBaseSecurityAdminRule.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.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Network base admin rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = ActiveBaseSecurityAdminRule.class) +@JsonTypeName("ActiveBaseSecurityAdminRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Custom", value = ActiveSecurityAdminRule.class), + @JsonSubTypes.Type(name = "Default", value = ActiveDefaultSecurityAdminRule.class) +}) +@Fluent +public class ActiveBaseSecurityAdminRule { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Deployment time string. + */ + @JsonProperty(value = "commitTime") + private OffsetDateTime commitTime; + + /* + * Deployment region. + */ + @JsonProperty(value = "region") + private String region; + + /* + * A description of the security admin configuration. + */ + @JsonProperty(value = "configurationDescription") + private String configurationDescription; + + /* + * A description of the rule collection. + */ + @JsonProperty(value = "ruleCollectionDescription") + private String ruleCollectionDescription; + + /* + * Groups for rule collection + */ + @JsonProperty(value = "ruleCollectionAppliesToGroups") + private List ruleCollectionAppliesToGroups; + + /* + * Effective configuration groups. + */ + @JsonProperty(value = "ruleGroups") + private List ruleGroups; + + /** Creates an instance of ActiveBaseSecurityAdminRule class. */ + public ActiveBaseSecurityAdminRule() { + } + + /** + * 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()); + } + } +} 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..feeef901b942c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConfigurationParameter.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective Virtual Networks Parameter. */ +@Fluent +public final class ActiveConfigurationParameter { + /* + * List of regions. + */ + @JsonProperty(value = "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. + */ + @JsonProperty(value = "skipToken") + 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() { + } +} 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..7e18e0c82566d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfiguration.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Active connectivity configuration. */ +@Fluent +public final class ActiveConnectivityConfiguration extends EffectiveConnectivityConfiguration { + /* + * Deployment time string. + */ + @JsonProperty(value = "commitTime") + private OffsetDateTime commitTime; + + /* + * Deployment region. + */ + @JsonProperty(value = "region") + private String region; + + /** 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; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withConfigurationGroups(List configurationGroups) { + super.withConfigurationGroups(configurationGroups); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withConnectivityTopology(ConnectivityTopology connectivityTopology) { + super.withConnectivityTopology(connectivityTopology); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withHubs(List hubs) { + super.withHubs(hubs); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withIsGlobal(IsGlobal isGlobal) { + super.withIsGlobal(isGlobal); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withAppliesToGroups(List appliesToGroups) { + super.withAppliesToGroups(appliesToGroups); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActiveConnectivityConfiguration withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + super.withDeleteExistingPeering(deleteExistingPeering); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..aa3040cd8a69a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfigurationsListResult.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.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..dcf8da25e0a7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveDefaultSecurityAdminRule.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.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Network default admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Default") +@Fluent +public final class ActiveDefaultSecurityAdminRule extends ActiveBaseSecurityAdminRule { + /* + * Indicates the properties of the default security admin rule + */ + @JsonProperty(value = "properties") + private DefaultAdminPropertiesFormat innerProperties; + + /** Creates an instance of ActiveDefaultSecurityAdminRule class. */ + public ActiveDefaultSecurityAdminRule() { + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..9c14fcfedef02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Network admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Custom") +@Fluent +public final class ActiveSecurityAdminRule extends ActiveBaseSecurityAdminRule { + /* + * Indicates the properties of the security admin rule + */ + @JsonProperty(value = "properties") + private AdminPropertiesFormat innerProperties; + + /** Creates an instance of ActiveSecurityAdminRule class. */ + public ActiveSecurityAdminRule() { + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..b4b22d95a8c14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRulesListResult.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.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..0c9d8320aabd0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixItem.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Address prefix item. */ +@Fluent +public final class AddressPrefixItem { + /* + * Address prefix. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Address prefix type. + */ + @JsonProperty(value = "addressPrefixType") + 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() { + } +} 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..4ec1aff86aa79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..82946c4f42913 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. */ +@Fluent +public final class AddressSpace { + /* + * A list of address blocks reserved for this virtual network in CIDR notation. + */ + @JsonProperty(value = "addressPrefixes") + 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() { + } +} 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..b7eb978514465 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRule.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.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Custom") +@Fluent +public final class AdminRule extends BaseAdminRuleInner { + /* + * Indicates the properties of the security admin rule + */ + @JsonProperty(value = "properties") + private AdminPropertiesFormat innerProperties; + + /** Creates an instance of AdminRule class. */ + public AdminRule() { + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private AdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..35c8c05a5f517 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollection.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.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 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..f54692b6ba32d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security admin configuration rule collection list result. */ +@Fluent +public final class AdminRuleCollectionListResult { + /* + * A list of network manager security admin configuration rule collections + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..bc79db1a39301 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollections.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.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..91970c512c492 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleKind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..d91071f1d533f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** security configuration admin rule list result. */ +@Fluent +public final class AdminRuleListResult { + /* + * A list of admin rules + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..f3cb474ee5308 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRules.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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/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..47273dd785d1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java @@ -0,0 +1,1020 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..7cec38ecf8dd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAuthenticationCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificate extends SubResource { + /* + * Properties of the application gateway authentication certificate. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayAuthenticationCertificatePropertiesFormat innerProperties; + + /* + * Name of the authentication certificate that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..8200f45da23a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Gateway autoscale configuration. */ +@Fluent +public final class ApplicationGatewayAutoscaleConfiguration { + /* + * Lower bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "minCapacity", required = true) + private int minCapacity; + + /* + * Upper bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "maxCapacity") + private Integer maxCapacity; + + /** 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() { + } +} 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..8794568e6c1ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationGatewayAvailableSslOptions. */ +public interface ApplicationGatewayAvailableSslOptions { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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..b1833f9683f09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableSslOptions API service call. */ +@Fluent +public final class ApplicationGatewayAvailableSslPredefinedPolicies { + /* + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..0c5a08586e750 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayAvailableWafRuleSetsResult. */ +public interface ApplicationGatewayAvailableWafRuleSetsResult { + /** + * Gets the value property: The list of application gateway rule sets. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayAvailableWafRuleSetsResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..3490718c92915 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backend address of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddress { + /* + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * IP address. + */ + @JsonProperty(value = "ipAddress") + 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() { + } +} 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..e4340fa227a05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendAddressPoolPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayBackendAddressPoolPropertiesFormat innerProperties; + + /* + * Name of the backend address pool that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java new file mode 100644 index 0000000000000..ea3f07d9fe718 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayBackendHealth. */ +public interface ApplicationGatewayBackendHealth { + /** + * Gets the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 0000000000000..a86507b0c59bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway BackendHealthHttp settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthHttpSettings { + /* + * Reference to an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /* + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java new file mode 100644 index 0000000000000..890d6baacbd45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthOnDemand. */ +public interface ApplicationGatewayBackendHealthOnDemand { + /** + * Gets the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + ApplicationGatewayBackendAddressPool backendAddressPool(); + + /** + * Gets the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value. + */ + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthOnDemandInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..4e8b3fc405748 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway BackendHealth pool. */ +@Fluent +public final class ApplicationGatewayBackendHealthPool { + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..f0aa53696f06c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthServer. */ +public interface ApplicationGatewayBackendHealthServer { + /** + * Gets the address property: IP address or FQDN of backend server. + * + * @return the address value. + */ + String address(); + + /** + * Gets the ipConfiguration property: Reference to IP configuration of backend server. + * + * @return the ipConfiguration value. + */ + NetworkInterfaceIpConfiguration ipConfiguration(); + + /** + * Gets the health property: Health of backend server. + * + * @return the health value. + */ + ApplicationGatewayBackendHealthServerHealth health(); + + /** + * Gets the healthProbeLog property: Health Probe Log. + * + * @return the healthProbeLog value. + */ + String healthProbeLog(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthServerInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..c26656199192c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..6830e0b6ddd85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHttpSettingsPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayBackendHttpSettingsPropertiesFormat innerProperties; + + /* + * Name of the backend http settings that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..15dc943be9c6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendSettingsPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayBackendSettingsPropertiesFormat innerProperties; + + /* + * Name of the backend settings that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..6082ae4074fdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.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.fasterxml.jackson.annotation.JsonProperty; + +/** Application gateway client authentication configuration. */ +@Fluent +public final class ApplicationGatewayClientAuthConfiguration { + /* + * Verify client certificate issuer name on the application gateway. + */ + @JsonProperty(value = "verifyClientCertIssuerDN") + private Boolean verifyClientCertIssuerDN; + + /* + * Verify client certificate revocation status. + */ + @JsonProperty(value = "verifyClientRevocation") + 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() { + } +} 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..88f7a515d35a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientRevocationOptions.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..dc7225d3dda37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection draining allows open connections to a backend server to be active for a specified time after the backend + * server got removed from the configuration. + */ +@Fluent +public final class ApplicationGatewayConnectionDraining { + /* + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** 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() { + } +} 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..ddc8ba13dbb05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..e1809ab28a6ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom error of an application gateway. */ +@Fluent +public final class ApplicationGatewayCustomError { + /* + * Status code of the application gateway custom error. + */ + @JsonProperty(value = "statusCode") + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /* + * Error page URL of the application gateway custom error. + */ + @JsonProperty(value = "customErrorPageUrl") + 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() { + } +} 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..429d2e5ceacf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.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 com.fasterxml.jackson.annotation.JsonCreator; +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 HttpStatus499 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS499 = fromString("HttpStatus499"); + + /** 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. + */ + @JsonCreator + 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..880c67004c5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allows to disable rules within a rule group or an entire rule group. */ +@Fluent +public final class ApplicationGatewayFirewallDisabledRuleGroup { + /* + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The list of rules that will be disabled. If null, all rules of the rule group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model" + + " ApplicationGatewayFirewallDisabledRuleGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallDisabledRuleGroup.class); +} 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..c3c21ef291cd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ApplicationGatewayFirewallExclusion { + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private String matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this + * exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private String selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + * applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model ApplicationGatewayFirewallExclusion")); + } + if (selectorMatchOperator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model" + + " ApplicationGatewayFirewallExclusion")); + } + if (selector() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selector in model ApplicationGatewayFirewallExclusion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallExclusion.class); +} 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..50582c1c9f0b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallManifestRuleSet.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the web application firewall rule set. */ +@Fluent +public final class ApplicationGatewayFirewallManifestRuleSet { + /* + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * The rule set status + */ + @JsonProperty(value = "status") + private ApplicationGatewayRuleSetStatusOptions status; + + /* + * Tier of an application gateway that support the rule set. + */ + @JsonProperty(value = "tiers") + private List tiers; + + /* + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "ruleGroups", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model ApplicationGatewayFirewallManifestRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetVersion in model ApplicationGatewayFirewallManifestRuleSet")); + } + if (ruleGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroups in model ApplicationGatewayFirewallManifestRuleSet")); + } else { + ruleGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallManifestRuleSet.class); +} 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..8fa72c82770bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/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..cdccb4bf2fc00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.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.fasterxml.jackson.annotation.JsonProperty; + +/** A web application firewall rule. */ +@Fluent +public final class ApplicationGatewayFirewallRule { + /* + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /* + * The string representation of the web application firewall rule identifier. + */ + @JsonProperty(value = "ruleIdString") + private String ruleIdString; + + /* + * The string representation of the web application firewall rule state. + */ + @JsonProperty(value = "state") + private ApplicationGatewayWafRuleStateTypes state; + + /* + * The string representation of the web application firewall rule action. + */ + @JsonProperty(value = "action") + private ApplicationGatewayWafRuleActionTypes action; + + /* + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + 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 description property: The description of the web application firewall rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the web application firewall rule. + * + * @param description the description value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..f274cf4b9d3dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A web application firewall rule group. */ +@Fluent +public final class ApplicationGatewayFirewallRuleGroup { + /* + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ApplicationGatewayFirewallRuleGroup")); + } + if (rules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rules in model ApplicationGatewayFirewallRuleGroup")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallRuleGroup.class); +} 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..5561a1c74b1fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.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.core.management.Resource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFirewallRuleSetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@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(); + } + } +} 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..ec7ca94087e3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendIpConfiguration extends SubResource { + /* + * Properties of the application gateway frontend IP configuration. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayFrontendIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the frontend IP configuration that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..d05cc267fbd52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendPortPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend port of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendPort extends SubResource { + /* + * Properties of the application gateway frontend port. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayFrontendPortPropertiesFormat innerProperties; + + /* + * Name of the frontend port that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..c84526a8924e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayGlobalConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Gateway global configuration. */ +@Fluent +public final class ApplicationGatewayGlobalConfiguration { + /* + * Enable request buffering. + */ + @JsonProperty(value = "enableRequestBuffering") + private Boolean enableRequestBuffering; + + /* + * Enable response buffering. + */ + @JsonProperty(value = "enableResponseBuffering") + 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() { + } +} 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..7885e9bb15990 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Header configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayHeaderConfiguration { + /* + * Header name of the header configuration. + */ + @JsonProperty(value = "headerName") + private String headerName; + + /* + * Header value of the header configuration. + */ + @JsonProperty(value = "headerValue") + 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 headerValue property: Header value of the header configuration. + * + * @return the headerValue value. + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set the headerValue property: Header value of the header configuration. + * + * @param headerValue the headerValue value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderValue(String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..dc1509563e235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayHttpListenerPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Http listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayHttpListener extends SubResource { + /* + * Properties of the application gateway HTTP listener. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayHttpListenerPropertiesFormat innerProperties; + + /* + * Name of the HTTP listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..7fbcb21f2942d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** 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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the IP configuration that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..fdcc71153dd20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListApplicationGateways API service call. */ +@Fluent +public final class ApplicationGatewayListResult { + /* + * List of an application gateways in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..72a8b068ee5d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListener.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayListenerPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayListener extends SubResource { + /* + * Properties of the application gateway listener. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayListenerPropertiesFormat innerProperties; + + /* + * Name of the listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..34d557ba43675 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..00300733f0334 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionPolicyPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayLoadDistributionPolicyPropertiesFormat innerProperties; + + /* + * Name of the load distribution policy that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..c99acd5f945b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionTargetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Load Distribution Target of an application gateway. */ +@Fluent +public final class ApplicationGatewayLoadDistributionTarget extends SubResource { + /* + * Properties of the application gateway load distribution target. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayLoadDistributionTargetPropertiesFormat innerProperties; + + /* + * Name of the load distribution policy that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..a58c2101ab18c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.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.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of on demand test probe request. */ +@Fluent +public final class ApplicationGatewayOnDemandProbe { + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. + * Acceptable values are from 1 second to 86400 seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * Whether the host header should be picked from the backend http settings. Default value is false. + */ + @JsonProperty(value = "pickHostNameFromBackendHttpSettings") + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * Reference to backend pool of application gateway to which probe request will be sent. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Reference to backend http setting of application gateway to be used for test probe. + */ + @JsonProperty(value = "backendHttpSettings") + private SubResource backendHttpSettings; + + /** 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(); + } + } +} 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..d53d44ddb33f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..a1b26f116f172 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPathRulePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPathRulePropertiesFormat innerProperties; + + /* + * Name of the path rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java new file mode 100644 index 0000000000000..0127495c5e034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; + +/** An immutable client-side representation of ApplicationGatewayPrivateEndpointConnection. */ +public interface ApplicationGatewayPrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the private endpoint connection on an application gateway. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the application gateway private endpoint + * connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + String linkIdentifier(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayPrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..5b19768cc34f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections + * for an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionListResult { + /* + * List of private endpoint connections on an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..453431439f5e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionProperties.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.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..6a19ec16c8ad8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.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.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..2873294a75f90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPrivateLinkConfigurationProperties innerProperties; + + /* + * Name of the private link configuration that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..cd1b7992ec714 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The application gateway private link ip configuration. */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfiguration extends SubResource { + /* + * Properties of an application gateway private link ip configuration. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayPrivateLinkIpConfigurationProperties innerProperties; + + /* + * The name of application gateway private link ip configuration. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java new file mode 100644 index 0000000000000..24fa564ee8997 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayPrivateLinkResource. */ +public interface ApplicationGatewayPrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the private link resource that is unique within an Application Gateway. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner object. + * + * @return the inner object. + */ + ApplicationGatewayPrivateLinkResourceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..cc348fd28d493 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an + * application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceListResult { + /* + * List of private link resources of an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..84a65c4161488 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.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..48435859033e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.resourcemanager.network.generated.fluent.models.ApplicationGatewayProbePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Probe of the application gateway. */ +@Fluent +public final class ApplicationGatewayProbe extends SubResource { + /* + * Properties of the application gateway probe. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayProbePropertiesFormat innerProperties; + + /* + * Name of the probe that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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 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 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(); + } + } +} 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..a488aa5c4f788 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway probe health response match. */ +@Fluent +public final class ApplicationGatewayProbeHealthResponseMatch { + /* + * Body that must be contained in the health response. Default value is empty. + */ + @JsonProperty(value = "body") + private String body; + + /* + * Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** 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() { + } +} 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..efd9a785c0e41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..7db1bf25b2462 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRedirectConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Redirect configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayRedirectConfiguration extends SubResource { + /* + * Properties of the application gateway redirect configuration. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayRedirectConfigurationPropertiesFormat innerProperties; + + /* + * Name of the redirect configuration that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..0cb16e6ddf7b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..398254ccab026 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRequestRoutingRulePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request routing rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRequestRoutingRule extends SubResource { + /* + * Properties of the application gateway request routing rule. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayRequestRoutingRulePropertiesFormat innerProperties; + + /* + * Name of the request routing rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..40d82be799291 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f6749d8a8ad8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rewrite rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRule { + /* + * Name of the rewrite rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a + * RewriteRuleSet. + */ + @JsonProperty(value = "ruleSequence") + private Integer ruleSequence; + + /* + * Conditions based on which the action set execution will be evaluated. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * Set of actions to be done as part of the rewrite Rule. + */ + @JsonProperty(value = "actionSet") + private ApplicationGatewayRewriteRuleActionSet actionSet; + + /** 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(); + } + } +} 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..b9ff5637c9e47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of actions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleActionSet { + /* + * Request Header Actions in the Action Set. + */ + @JsonProperty(value = "requestHeaderConfigurations") + private List requestHeaderConfigurations; + + /* + * Response Header Actions in the Action Set. + */ + @JsonProperty(value = "responseHeaderConfigurations") + private List responseHeaderConfigurations; + + /* + * Url Configuration Action in the Action Set. + */ + @JsonProperty(value = "urlConfiguration") + private ApplicationGatewayUrlConfiguration urlConfiguration; + + /** 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(); + } + } +} 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..ed57277822706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Set of conditions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleCondition { + /* + * The condition parameter of the RewriteRuleCondition. + */ + @JsonProperty(value = "variable") + private String variable; + + /* + * The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * Setting this value as truth will force to check the negation of the condition given by the user. + */ + @JsonProperty(value = "negate") + private Boolean negate; + + /** 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() { + } +} 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..49e7995dc9f52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayRewriteRuleSetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayRewriteRuleSetPropertiesFormat innerProperties; + + /* + * Name of the rewrite rule set that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..832010c4fd138 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRoutingRule.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRoutingRulePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Routing rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRoutingRule extends SubResource { + /* + * Properties of the application gateway routing rule. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayRoutingRulePropertiesFormat innerProperties; + + /* + * Name of the routing rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..3dafe36ac410e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRuleSetStatusOptions.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..da093dc7d7b60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of an application gateway. */ +@Fluent +public final class ApplicationGatewaySku { + /* + * Name of an application gateway SKU. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /* + * Tier of an application gateway. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /* + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..be4bf50834818 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.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 com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..5fe12dfcc63a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSL certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslCertificate extends SubResource { + /* + * Properties of the application gateway SSL certificate. + */ + @JsonProperty(value = "properties") + private ApplicationGatewaySslCertificatePropertiesFormat innerProperties; + + /* + * Name of the SSL certificate that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..ebd0b2c8afe5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..5273426d3be88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Gateway Ssl policy. */ +@Fluent +public final class ApplicationGatewaySslPolicy { + /* + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /* + * Type of Ssl Policy. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /* + * Name of Ssl predefined policy. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /* + * Ssl cipher suites to be enabled in the specified order to application gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** 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() { + } +} 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..226d07aaa9041 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..d89986f9023d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f4d30389d497a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewaySslPredefinedPolicy. */ +public interface ApplicationGatewaySslPredefinedPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the Ssl predefined policy. + * + * @return the name value. + */ + String name(); + + /** + * Gets the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * Gets the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner object. + * + * @return the inner object. + */ + ApplicationGatewaySslPredefinedPolicyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java new file mode 100644 index 0000000000000..c06e31d23f112 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.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.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslProfilePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSL profile of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslProfile extends SubResource { + /* + * Properties of the application gateway SSL profile. + */ + @JsonProperty(value = "properties") + private ApplicationGatewaySslProfilePropertiesFormat innerProperties; + + /* + * Name of the SSL profile that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..c7056495edf41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..c17c1efa0ff09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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"); + + /** + * 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. + */ + @JsonCreator + 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..5d784ae5e5846 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTierTypes.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for 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. + */ + @JsonCreator + 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..4d9486e9d0cba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedClientCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted client certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificate extends SubResource { + /* + * Properties of the application gateway trusted client certificate. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayTrustedClientCertificatePropertiesFormat innerProperties; + + /* + * Name of the trusted client certificate that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..f1dada2bea5ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedRootCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificate extends SubResource { + /* + * Properties of the application gateway trusted root certificate. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayTrustedRootCertificatePropertiesFormat innerProperties; + + /* + * Name of the trusted root certificate that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..30b1722514c62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.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.fasterxml.jackson.annotation.JsonProperty; + +/** Url configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayUrlConfiguration { + /* + * Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. + */ + @JsonProperty(value = "modifiedPath") + private String modifiedPath; + + /* + * Query string which user has provided for url rewrite. Null means no query string will be updated. Default value + * is null. + */ + @JsonProperty(value = "modifiedQueryString") + private String modifiedQueryString; + + /* + * If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified + * path. Default value is false. + */ + @JsonProperty(value = "reroute") + private Boolean reroute; + + /** 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() { + } +} 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..d61ff9ed750ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayUrlPathMapPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayUrlPathMapPropertiesFormat innerProperties; + + /* + * Name of the URL path map that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..1524e97d400e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResult.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..39b4ae2faaf7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResultList.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayWafDynamicManifests API service call. */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestResultList { + /* + * The list of application gateway waf manifest. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..1a3422edb79d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of 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..874b603cb9213 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestsDefaults.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 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..3639540b2df14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleActionTypes.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..987665216c8a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleStateTypes.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..eb4527c27b384 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway web application firewall configuration. */ +@Fluent +public final class ApplicationGatewayWebApplicationFirewallConfiguration { + /* + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Web application firewall mode. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /* + * The type of the web application firewall rule set. Possible values are: 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /* + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /* + * The exclusion list. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property firewallMode in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetVersion in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (disabledRuleGroups() != null) { + disabledRuleGroups().forEach(e -> e.validate()); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(ApplicationGatewayWebApplicationFirewallConfiguration.class); +} 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..5a668d73e6cef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.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.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..67b25e9a1eb99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type application. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("ApplicationRule") +@Fluent +public final class ApplicationRule extends FirewallPolicyRule { + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * Array of Application Protocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of Urls for this rule condition. + */ + @JsonProperty(value = "targetUrls") + private List targetUrls; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * Terminate TLS connections for this rule. + */ + @JsonProperty(value = "terminateTLS") + private Boolean terminateTls; + + /* + * List of destination azure web categories. + */ + @JsonProperty(value = "webCategories") + private List webCategories; + + /** Creates an instance of ApplicationRule class. */ + public ApplicationRule() { + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the protocols property: Array of Application Protocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of Application Protocols. + * + * @param protocols the protocols value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the targetFqdns property: List of FQDNs for this rule. + * + * @return the targetFqdns value. + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set the targetFqdns property: List of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get the targetUrls property: List of Urls for this rule condition. + * + * @return the targetUrls value. + */ + public List targetUrls() { + return this.targetUrls; + } + + /** + * Set the targetUrls property: List of Urls for this rule condition. + * + * @param targetUrls the targetUrls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetUrls(List targetUrls) { + this.targetUrls = targetUrls; + return this; + } + + /** + * Get the fqdnTags property: List of FQDN Tags for this rule. + * + * @return the fqdnTags value. + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set the fqdnTags property: List of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the terminateTls property: Terminate TLS connections for this rule. + * + * @return the terminateTls value. + */ + public Boolean terminateTls() { + return this.terminateTls; + } + + /** + * Set the terminateTls property: Terminate TLS connections for this rule. + * + * @param terminateTls the terminateTls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTerminateTls(Boolean terminateTls) { + this.terminateTls = terminateTls; + return this; + } + + /** + * Get the webCategories property: List of destination azure web categories. + * + * @return the webCategories value. + */ + public List webCategories() { + return this.webCategories; + } + + /** + * Set the webCategories property: List of destination azure web categories. + * + * @param webCategories the webCategories value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withWebCategories(List webCategories) { + this.webCategories = webCategories; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..4f708446c0679 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.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.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..0503870a21878 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of application security groups. */ +@Fluent +public final class ApplicationSecurityGroupListResult { + /* + * A list of application security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..f6dc7b58cf9b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationSecurityGroups. */ +public interface ApplicationSecurityGroups { + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..474a36bbc2fb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..a332b62e2eb80 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..1ff8174683838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + */ +@Fluent +public final class AuthorizationListResult { + /* + * The authorizations in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..976d23a51004f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..45e1bb84ff428 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; + +/** An immutable client-side representation of AutoApprovedPrivateLinkService. */ +public interface AutoApprovedPrivateLinkService { + /** + * Gets the privateLinkService property: The id of the private link service resource. + * + * @return the privateLinkService value. + */ + String privateLinkService(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner + * object. + * + * @return the inner object. + */ + AutoApprovedPrivateLinkServiceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java new file mode 100644 index 0000000000000..b423558735fa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of private link service id that can be linked to a private end point with auto approved. */ +@Fluent +public final class AutoApprovedPrivateLinkServicesResult { + /* + * An array of auto approved private link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..5faf300a66014 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoLearnPrivateRangesMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..6145c9b80fc39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Availability of the metric. */ +@Fluent +public final class Availability { + /* + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /* + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java new file mode 100644 index 0000000000000..5780fce3545dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import java.util.List; + +/** An immutable client-side representation of AvailableDelegation. */ +public interface AvailableDelegation { + /** + * Gets the name property: The name of the AvailableDelegation resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailableDelegation resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the serviceName property: The name of the service and resource. + * + * @return the serviceName value. + */ + String serviceName(); + + /** + * Gets the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner object. + * + * @return the inner object. + */ + AvailableDelegationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java new file mode 100644 index 0000000000000..141f6c5851fca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.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 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..aaa1e7535c381 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available delegations. */ +@Fluent +public final class AvailableDelegationsResult { + /* + * An array of available delegations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..221f980cea43f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.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 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..e3bc1fd8de6e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An immutable client-side representation of AvailablePrivateEndpointType. */ +public interface AvailablePrivateEndpointType { + /** + * Gets the name property: The name of the service and resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The name of the service and resource. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner + * object. + * + * @return the inner object. + */ + AvailablePrivateEndpointTypeInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java new file mode 100644 index 0000000000000..57e4ab64ebe37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailablePrivateEndpointTypes. */ +public interface AvailablePrivateEndpointTypes { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types 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..27f29085c7957 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available PrivateEndpoint types. */ +@Fluent +public final class AvailablePrivateEndpointTypesResult { + /* + * An array of available privateEndpoint type. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java new file mode 100644 index 0000000000000..1ec2bd562383b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import java.util.List; + +/** An immutable client-side representation of AvailableProvidersList. */ +public interface AvailableProvidersList { + /** + * Gets the countries property: List of available countries. + * + * @return the countries value. + */ + List countries(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner object. + * + * @return the inner object. + */ + AvailableProvidersListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..b1c3ffe6cd3e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** City or town details. */ +@Fluent +public final class AvailableProvidersListCity { + /* + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "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() { + } +} 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..8398ddf833a76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Country details. */ +@Fluent +public final class AvailableProvidersListCountry { + /* + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** 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()); + } + } +} 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..74e1987ccf797 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Constraints that determine the list of available Internet service providers. */ +@Fluent +public final class AvailableProvidersListParameters { + /* + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /* + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** 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() { + } +} 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..98d4b7da760c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** State details. */ +@Fluent +public final class AvailableProvidersListState { + /* + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** 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()); + } + } +} 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..a185e79bc487b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.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 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..53f0e41492495 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; + +/** An immutable client-side representation of AvailableServiceAlias. */ +public interface AvailableServiceAlias { + /** + * Gets the name property: The name of the service alias. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the service alias. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The resource name of the service alias. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner object. + * + * @return the inner object. + */ + AvailableServiceAliasInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java new file mode 100644 index 0000000000000..5c20d7a86ad7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.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.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..d3e3a951620e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available service aliases. */ +@Fluent +public final class AvailableServiceAliasesResult { + /* + * An array of available service aliases. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..37e0ceb317b98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.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.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 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + AzureFirewall create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureFirewall create(Context context); + } + /** The stage of the AzureFirewall definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the AzureFirewall definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the AzureFirewall definition allowing to specify applicationRuleCollections. */ + interface WithApplicationRuleCollections { + /** + * Specifies the applicationRuleCollections property: Collection of application rule collections used by + * Azure Firewall.. + * + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withApplicationRuleCollections( + List applicationRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify natRuleCollections. */ + interface WithNatRuleCollections { + /** + * Specifies the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall.. + * + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNatRuleCollections(List natRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify networkRuleCollections. */ + interface WithNetworkRuleCollections { + /** + * Specifies the networkRuleCollections property: Collection of network rule collections used by Azure + * Firewall.. + * + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Azure Firewall resource.. + * + * @param ipConfigurations IP configuration of the Azure Firewall resource. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the AzureFirewall definition allowing to specify managementIpConfiguration. */ + interface WithManagementIpConfiguration { + /** + * Specifies the managementIpConfiguration property: IP configuration of the Azure Firewall used for + * management traffic.. + * + * @param managementIpConfiguration IP configuration of the Azure Firewall used for management traffic. + * @return the next definition stage. + */ + WithCreate withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration); + } + /** The stage of the AzureFirewall definition allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + WithCreate withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the AzureFirewall definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The virtualHub to which the firewall belongs.. + * + * @param virtualHub The virtualHub to which the firewall belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the AzureFirewall definition allowing to specify firewallPolicy. */ + interface WithFirewallPolicy { + /** + * Specifies the firewallPolicy property: The firewallPolicy associated with this azure firewall.. + * + * @param firewallPolicy The firewallPolicy associated with this azure firewall. + * @return the next definition stage. + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** The stage of the AzureFirewall definition allowing to specify hubIpAddresses. */ + interface WithHubIpAddresses { + /** + * Specifies the hubIpAddresses property: IP addresses associated with AzureFirewall.. + * + * @param hubIpAddresses IP addresses associated with AzureFirewall. + * @return the next definition stage. + */ + WithCreate withHubIpAddresses(HubIpAddresses hubIpAddresses); + } + /** The stage of the AzureFirewall definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Azure Firewall Resource SKU.. + * + * @param sku The Azure Firewall Resource SKU. + * @return the next definition stage. + */ + WithCreate withSku(AzureFirewallSku sku); + } + /** The stage of the AzureFirewall definition allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: The additional properties used to further config this azure + * firewall.. + * + * @param additionalProperties The additional properties used to further config this azure firewall. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(Map additionalProperties); + } + } + /** + * Begins update for the AzureFirewall resource. + * + * @return the stage of resource update. + */ + AzureFirewall.Update update(); + + /** The template for AzureFirewall update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureFirewall apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureFirewall apply(Context context); + } + /** The AzureFirewall update stages. */ + interface UpdateStages { + /** The stage of the AzureFirewall update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureFirewall refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureFirewall refresh(Context context); + + /** + * 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); +} 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..81e9429dece77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of an application rule. */ +@Fluent +public final class AzureFirewallApplicationRule { + /* + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** 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()); + } + } +} 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..5a930e988490c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallApplicationRuleCollectionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application rule collection resource. */ +@Fluent +public final class AzureFirewallApplicationRuleCollection extends SubResource { + /* + * Properties of the azure firewall application rule collection. + */ + @JsonProperty(value = "properties") + private AzureFirewallApplicationRuleCollectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..8c6bbefded787 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the application rule protocol. */ +@Fluent +public final class AzureFirewallApplicationRuleProtocol { + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. This field is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** 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() { + } +} 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..ac81c86035d11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..64896f2fcb28c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import java.util.Map; + +/** An immutable client-side representation of AzureFirewallFqdnTag. */ +public interface AzureFirewallFqdnTag { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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..e3ebf7cf16f7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewallFqdnTags API service call. */ +@Fluent +public final class AzureFirewallFqdnTagListResult { + /* + * List of Azure Firewall FQDN Tags in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..d882c752f8f04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AzureFirewallFqdnTags. */ +public interface AzureFirewallFqdnTags { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription 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..0646966b0f2d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Azure Firewall. */ +@Fluent +public final class AzureFirewallIpConfiguration extends SubResource { + /* + * Properties of the azure firewall IP configuration. + */ + @JsonProperty(value = "properties") + private AzureFirewallIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..a6493f3aae24f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpGroups associated with azure firewall. */ +@Immutable +public final class AzureFirewallIpGroups { + /* + * Resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /** 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() { + } +} 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..93321bed63eab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewalls API service call. */ +@Fluent +public final class AzureFirewallListResult { + /* + * List of Azure Firewalls in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..eb501f9d089de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AzureFirewall NAT Rule Collection Action. */ +@Fluent +public final class AzureFirewallNatRCAction { + /* + * The type of action. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..f7434e9acedda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..ce62a55d8cc33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a NAT rule. */ +@Fluent +public final class AzureFirewallNatRule { + /* + * Name of the NAT rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** 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() { + } +} 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..5c09f07a2902a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNatRuleCollectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NAT rule collection resource. */ +@Fluent +public final class AzureFirewallNatRuleCollection extends SubResource { + /* + * Properties of the azure firewall NAT rule collection. + */ + @JsonProperty(value = "properties") + private AzureFirewallNatRuleCollectionProperties innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..ce953910aa7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the network rule. */ +@Fluent +public final class AzureFirewallNetworkRule { + /* + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** 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() { + } +} 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..04b48f541bf58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNetworkRuleCollectionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network rule collection resource. */ +@Fluent +public final class AzureFirewallNetworkRuleCollection extends SubResource { + /* + * Properties of the azure firewall network rule collection. + */ + @JsonProperty(value = "properties") + private AzureFirewallNetworkRuleCollectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..241078c90ce2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/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..70d785b809a38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Public IP Address associated with azure firewall. */ +@Fluent +public final class AzureFirewallPublicIpAddress { + /* + * Public IP Address value. + */ + @JsonProperty(value = "address") + 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() { + } +} 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..0f7cec9d2e171 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the AzureFirewallRCAction. */ +@Fluent +public final class AzureFirewallRCAction { + /* + * The type of action. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..c4d7d5297e6b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..cd0ed4cbc29a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of an Azure Firewall. */ +@Fluent +public final class AzureFirewallSku { + /* + * Name of an Azure Firewall SKU. + */ + @JsonProperty(value = "name") + private AzureFirewallSkuName name; + + /* + * Tier of an Azure Firewall. + */ + @JsonProperty(value = "tier") + 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() { + } +} 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..6945918115567 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..da05b6bf332cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f86d0a72b5111 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..796baa4fa0cfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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); + + /** + * 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..ff1f4194f903b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import java.util.List; + +/** An immutable client-side representation of AzureReachabilityReport. */ +public interface AzureReachabilityReport { + /** + * Gets the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * Gets the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * Gets the reachabilityReport property: List of Azure reachability report items. + * + * @return the reachabilityReport value. + */ + List reachabilityReport(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner object. + * + * @return the inner object. + */ + AzureReachabilityReportInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java new file mode 100644 index 0000000000000..f86ce2b4ce216 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure reachability report details for a given provider location. */ +@Fluent +public final class AzureReachabilityReportItem { + /* + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /* + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** 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()); + } + } +} 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..b22da614723fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Details on latency for a time series. */ +@Fluent +public final class AzureReachabilityReportLatencyInfo { + /* + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private OffsetDateTime timestamp; + + /* + * The relative latency score between 1 and 100, higher values indicating a faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** 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() { + } +} 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..f3f4e8eca2706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define a geographic location. */ +@Fluent +public final class AzureReachabilityReportLocation { + /* + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /* + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property country in model AzureReachabilityReportLocation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportLocation.class); +} 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..89e524fac9465 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Geographic and time constraints for Azure reachability report. */ +@Fluent +public final class AzureReachabilityReportParameters { + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportParameters")); + } else { + providerLocation().validate(); + } + if (startTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model AzureReachabilityReportParameters")); + } + if (endTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTime in model AzureReachabilityReportParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportParameters.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java new file mode 100644 index 0000000000000..bb997605d6f3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; + +/** An immutable client-side representation of AzureWebCategory. */ +public interface AzureWebCategory { + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the group property: The name of the group that the category belongs to. + * + * @return the group value. + */ + String group(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner object. + * + * @return the inner object. + */ + AzureWebCategoryInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java new file mode 100644 index 0000000000000..72483d786f0f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureWebCategories API service call. */ +@Fluent +public final class AzureWebCategoryListResult { + /* + * List of Azure Web Categories for a given Subscription. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..7aef8f5df7034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressInboundNatRulePortMappings.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.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..f5e14bf7c357a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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..5ba534fead856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BaseAdminRule.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.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 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..9de110aad1318 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; + +/** An immutable client-side representation of BastionActiveSession. */ +public interface BastionActiveSession { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the startTime property: The time when the session started. + * + * @return the startTime value. + */ + Object startTime(); + + /** + * Gets the targetSubscriptionId property: The subscription id for the target virtual machine. + * + * @return the targetSubscriptionId value. + */ + String targetSubscriptionId(); + + /** + * Gets the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the targetHostname property: The host name of the target. + * + * @return the targetHostname value. + */ + String targetHostname(); + + /** + * Gets the targetResourceGroup property: The resource group of the target. + * + * @return the targetResourceGroup value. + */ + String targetResourceGroup(); + + /** + * Gets the username property: The user name who is active on this session. + * + * @return the username value. + */ + String username(); + + /** + * Gets the targetIpAddress property: The IP Address of the target. + * + * @return the targetIpAddress value. + */ + String targetIpAddress(); + + /** + * Gets the protocol property: The protocol used to connect to the target. + * + * @return the protocol value. + */ + BastionConnectProtocol protocol(); + + /** + * Gets the targetResourceId property: The resource id of the target. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the sessionDurationInMins property: Duration in mins the session has been active. + * + * @return the sessionDurationInMins value. + */ + Float sessionDurationInMins(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner object. + * + * @return the inner object. + */ + BastionActiveSessionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java new file mode 100644 index 0000000000000..bf95d755b7be3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for GetActiveSessions. */ +@Fluent +public final class BastionActiveSessionListResult { + /* + * List of active sessions on the bastion. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..84c922bb91cec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..5907f69412526 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.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.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BastionHost. */ +public interface BastionHost { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the sku property: The sku of this Bastion Host. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the 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 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 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.WithSku, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithDnsName, + DefinitionStages.WithScaleUnits, + DefinitionStages.WithDisableCopyPaste, + DefinitionStages.WithEnableFileCopy, + DefinitionStages.WithEnableIpConnect, + DefinitionStages.WithEnableShareableLink, + DefinitionStages.WithEnableTunneling { + /** + * Executes the create request. + * + * @return the created resource. + */ + BastionHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BastionHost create(Context context); + } + /** The stage of the BastionHost definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the BastionHost definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of this Bastion Host.. + * + * @param sku The sku of this Bastion Host. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the BastionHost definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Bastion Host resource.. + * + * @param ipConfigurations IP configuration of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the BastionHost definition allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: FQDN for the endpoint on which bastion host is accessible.. + * + * @param dnsName FQDN for the endpoint on which bastion host is accessible. + * @return the next definition stage. + */ + WithCreate withDnsName(String dnsName); + } + /** 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); + } + } + /** + * 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..4bdd57353e8f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Bastion Host. */ +@Fluent +public final class BastionHostIpConfiguration extends SubResource { + /* + * Represents the ip configuration associated with the resource. + */ + @JsonProperty(value = "properties") + private BastionHostIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Ip configuration type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..427b33062a48a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBastionHosts API service call. */ +@Fluent +public final class BastionHostListResult { + /* + * List of Bastion Hosts in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..2555724c50874 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name 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"); + + /** + * 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. + */ + @JsonCreator + 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..dd5e14ea100fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BastionHosts. */ +public interface BastionHosts { + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String bastionHostname, Context context); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..51f65671c05ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for DisconnectActiveSessions. */ +@Fluent +public final class BastionSessionDeleteResult { + /* + * List of sessions with their corresponding state. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java new file mode 100644 index 0000000000000..c8caf45ea8b1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; + +/** An immutable client-side representation of BastionSessionState. */ +public interface BastionSessionState { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the message property: Used for extra information. + * + * @return the message value. + */ + String message(); + + /** + * Gets the state property: The state of the session. Disconnected/Failed/NotFound. + * + * @return the state value. + */ + String state(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner object. + * + * @return the inner object. + */ + BastionSessionStateInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java new file mode 100644 index 0000000000000..d48f19c935d7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; + +/** An immutable client-side representation of BastionShareableLink. */ +public interface BastionShareableLink { + /** + * Gets the vm property: Reference of the virtual machine resource. + * + * @return the vm value. + */ + VM vm(); + + /** + * Gets the bsl property: The unique Bastion Shareable Link to the virtual machine. + * + * @return the bsl value. + */ + String bsl(); + + /** + * Gets the createdAt property: The time when the link was created. + * + * @return the createdAt value. + */ + String createdAt(); + + /** + * Gets the message property: Optional field indicating the warning or error message related to the vm in case of + * partial failure. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner object. + * + * @return the inner object. + */ + BastionShareableLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java new file mode 100644 index 0000000000000..2b6352b7f3fb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Post request for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListRequest { + /* + * List of VM references. + */ + @JsonProperty(value = "vms") + 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()); + } + } +} 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..34e94cb4eece8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListResult { + /* + * List of Bastion Shareable Links for the request. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..4c9e47de3843c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains bgp community information offered in Service Community resources. */ +@Fluent +public final class BgpCommunity { + /* + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /* + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /* + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /* + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /* + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /* + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** 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() { + } +} 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..52cb2eebc55fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.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..4f53dc156e894 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..866a1b7010225 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BGP peer status details. */ +@Immutable +public final class BgpPeerStatus { + /* + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /* + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Long asn; + + /* + * The BGP peer state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /* + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /* + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /* + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /* + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..dcff9d96ec080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import java.util.List; + +/** An immutable client-side representation of BgpPeerStatusListResult. */ +public interface BgpPeerStatusListResult { + /** + * Gets the value property: List of BGP peers. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner object. + * + * @return the inner object. + */ + BgpPeerStatusListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java new file mode 100644 index 0000000000000..2fcf113192da7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BgpServiceCommunities. */ +public interface BgpServiceCommunities { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities 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..336fb4c7da9e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BgpServiceCommunity. */ +public interface BgpServiceCommunity { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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..217296564cebe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceCommunity API service call. */ +@Fluent +public final class BgpServiceCommunityListResult { + /* + * A list of service community resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..c8e6afefe003a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BGP settings details. */ +@Fluent +public final class BgpSettings { + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /* + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /* + * BGP peering address with IP configuration ID for virtual network gateway. + */ + @JsonProperty(value = "bgpPeeringAddresses") + private List bgpPeeringAddresses; + + /** 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()); + } + } +} 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..6f43c86c4e7c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class BreakOutCategoryPolicies { + /* + * Flag to control breakout of o365 allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control breakout of o365 optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control breakout of o365 default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** 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() { + } +} 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..115d8e68c9092 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request body of the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class CheckPrivateLinkServiceVisibilityRequest { + /* + * The alias of the private link service. + */ + @JsonProperty(value = "privateLinkServiceAlias") + 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() { + } +} 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..e44b545629e66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ChildResource.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Proxy resource representation. */ +@Immutable +public class ChildResource extends ProxyResource { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..ef66761ee9aa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..456c677ada4ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..3f5fed8f4f56f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationGroup.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.resourcemanager.network.generated.fluent.models.NetworkGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network configuration group resource. */ +@Fluent +public final class ConfigurationGroup { + /* + * Network group ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The network configuration group properties + */ + @JsonProperty(value = "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 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. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..628e53bce3cae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationPolicyGroups.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 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..51f49a3018780 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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"); + + /** + * 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. + */ + @JsonCreator + 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..560a432cc347d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Parameters that define the operation to create a connection monitor. */ +@Fluent +public final class ConnectionMonitor { + /* + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the connection monitor. + */ + @JsonProperty(value = "properties", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ConnectionMonitor")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitor.class); +} 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..371132cd7230c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the destination of connection monitor. */ +@Fluent +public final class ConnectionMonitorDestination { + /* + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** 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() { + } +} 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..d1ca2d01ae0d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint. */ +@Fluent +public final class ConnectionMonitorEndpoint { + /* + * The name of the connection monitor endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The endpoint type. + */ + @JsonProperty(value = "type") + private EndpointType type; + + /* + * Resource ID of the connection monitor endpoint. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor endpoint (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * Filter for sub-items within the endpoint. + */ + @JsonProperty(value = "filter") + private ConnectionMonitorEndpointFilter filter; + + /* + * Endpoint scope. + */ + @JsonProperty(value = "scope") + private ConnectionMonitorEndpointScope scope; + + /* + * Test coverage for the endpoint. + */ + @JsonProperty(value = "coverageLevel") + private CoverageLevel coverageLevel; + + /** 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. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the connection monitor endpoint. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the filter property: Filter for sub-items within the endpoint. + * + * @return the filter value. + */ + public ConnectionMonitorEndpointFilter filter() { + return this.filter; + } + + /** + * Set the filter property: Filter for sub-items within the endpoint. + * + * @param filter the filter value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withFilter(ConnectionMonitorEndpointFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the scope property: Endpoint scope. + * + * @return the scope value. + */ + public ConnectionMonitorEndpointScope scope() { + return this.scope; + } + + /** + * Set the scope property: Endpoint scope. + * + * @param scope the scope value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withScope(ConnectionMonitorEndpointScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the coverageLevel property: Test coverage for the endpoint. + * + * @return the coverageLevel value. + */ + public CoverageLevel coverageLevel() { + return this.coverageLevel; + } + + /** + * Set the coverageLevel property: Test coverage for the endpoint. + * + * @param coverageLevel the coverageLevel value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withCoverageLevel(CoverageLevel coverageLevel) { + this.coverageLevel = coverageLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ConnectionMonitorEndpoint")); + } + if (filter() != null) { + filter().validate(); + } + if (scope() != null) { + scope().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorEndpoint.class); +} 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..3351bf206c272 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor endpoint filter. */ +@Fluent +public final class ConnectionMonitorEndpointFilter { + /* + * The behavior of the endpoint filter. Currently only 'Include' is supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterType type; + + /* + * List of items in the filter. + */ + @JsonProperty(value = "items") + private List items; + + /** 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()); + } + } +} 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..da34b592b56b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint filter item. */ +@Fluent +public final class ConnectionMonitorEndpointFilterItem { + /* + * The type of item included in the filter. Currently only 'AgentAddress' is supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterItemType type; + + /* + * The address of the filter item. + */ + @JsonProperty(value = "address") + private String address; + + /** 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() { + } +} 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..d2ba57b189ac0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..cebe6bb3aee6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..c50c5832386d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor endpoint scope. */ +@Fluent +public final class ConnectionMonitorEndpointScope { + /* + * List of items which needs to be included to the endpoint scope. + */ + @JsonProperty(value = "include") + private List include; + + /* + * List of items which needs to be excluded from the endpoint scope. + */ + @JsonProperty(value = "exclude") + private List exclude; + + /** 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()); + } + } +} 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..bd2f7bed5f197 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint scope item. */ +@Fluent +public final class ConnectionMonitorEndpointScopeItem { + /* + * The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. + */ + @JsonProperty(value = "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() { + } +} 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..e763092f03984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the HTTP configuration. */ +@Fluent +public final class ConnectionMonitorHttpConfiguration { + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The HTTP method to use. + */ + @JsonProperty(value = "method") + private HttpConfigurationMethod method; + + /* + * The path component of the URI. For instance, "/dir1/dir2". + */ + @JsonProperty(value = "path") + private String path; + + /* + * The HTTP headers to transmit with the request. + */ + @JsonProperty(value = "requestHeaders") + private List requestHeaders; + + /* + * HTTP status codes to consider successful. For instance, "2xx,301-304,418". + */ + @JsonProperty(value = "validStatusCodeRanges") + private List validStatusCodeRanges; + + /* + * Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. + */ + @JsonProperty(value = "preferHTTPS") + private Boolean preferHttps; + + /** 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()); + } + } +} 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..ca9345dbba714 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the ICMP configuration. */ +@Fluent +public final class ConnectionMonitorIcmpConfiguration { + /* + * Value indicating whether path evaluation with trace route should be disabled. + */ + @JsonProperty(value = "disableTraceRoute") + 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() { + } +} 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..c1481d1b3df71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection monitors. */ +@Fluent +public final class ConnectionMonitorListResult { + /* + * Information about connection monitors. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..fb989c343d855 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a connection monitor output destination. */ +@Fluent +public final class ConnectionMonitorOutput { + /* + * Connection monitor output destination type. Currently, only "Workspace" is supported. + */ + @JsonProperty(value = "type") + private OutputType type; + + /* + * Describes the settings for producing output into a log analytics workspace. + */ + @JsonProperty(value = "workspaceSettings") + private ConnectionMonitorWorkspaceSettings workspaceSettings; + + /** 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java new file mode 100644 index 0000000000000..5cf38d4040166 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** An immutable client-side representation of ConnectionMonitorQueryResult. */ +public interface ConnectionMonitorQueryResult { + /** + * Gets the sourceStatus property: Status of connection monitor source. + * + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * Gets the states property: Information about connection states. + * + * @return the states value. + */ + List states(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner + * object. + * + * @return the inner object. + */ + ConnectionMonitorQueryResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java new file mode 100644 index 0000000000000..829639e85319e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..5c82d0f29c1c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the source of connection monitor. */ +@Fluent +public final class ConnectionMonitorSource { + /* + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceId in model ConnectionMonitorSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorSource.class); +} 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..c9e6423384093 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..1d7f000e39ea0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the threshold for declaring a test successful. */ +@Fluent +public final class ConnectionMonitorSuccessThreshold { + /* + * The maximum percentage of failed checks permitted for a test to evaluate as successful. + */ + @JsonProperty(value = "checksFailedPercent") + private Integer checksFailedPercent; + + /* + * The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. + */ + @JsonProperty(value = "roundTripTimeMs") + private Float roundTripTimeMs; + + /** 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() { + } +} 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..9e863e2d7637b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the TCP configuration. */ +@Fluent +public final class ConnectionMonitorTcpConfiguration { + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Value indicating whether path evaluation with trace route should be disabled. + */ + @JsonProperty(value = "disableTraceRoute") + private Boolean disableTraceRoute; + + /* + * Destination port behavior. + */ + @JsonProperty(value = "destinationPortBehavior") + private DestinationPortBehavior destinationPortBehavior; + + /** 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() { + } +} 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..acedcb9c8655d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a connection monitor test configuration. */ +@Fluent +public final class ConnectionMonitorTestConfiguration { + /* + * The name of the connection monitor test configuration. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The frequency of test evaluation, in seconds. + */ + @JsonProperty(value = "testFrequencySec") + private Integer testFrequencySec; + + /* + * The protocol to use in test evaluation. + */ + @JsonProperty(value = "protocol", required = true) + private ConnectionMonitorTestConfigurationProtocol protocol; + + /* + * The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version + * depending on other parameters. + */ + @JsonProperty(value = "preferredIPVersion") + private PreferredIpVersion preferredIpVersion; + + /* + * The parameters used to perform test evaluation over HTTP. + */ + @JsonProperty(value = "httpConfiguration") + private ConnectionMonitorHttpConfiguration httpConfiguration; + + /* + * The parameters used to perform test evaluation over TCP. + */ + @JsonProperty(value = "tcpConfiguration") + private ConnectionMonitorTcpConfiguration tcpConfiguration; + + /* + * The parameters used to perform test evaluation over ICMP. + */ + @JsonProperty(value = "icmpConfiguration") + private ConnectionMonitorIcmpConfiguration icmpConfiguration; + + /* + * The threshold for declaring a test successful. + */ + @JsonProperty(value = "successThreshold") + private ConnectionMonitorSuccessThreshold successThreshold; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ConnectionMonitorTestConfiguration")); + } + if (protocol() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model ConnectionMonitorTestConfiguration")); + } + if (httpConfiguration() != null) { + httpConfiguration().validate(); + } + if (tcpConfiguration() != null) { + tcpConfiguration().validate(); + } + if (icmpConfiguration() != null) { + icmpConfiguration().validate(); + } + if (successThreshold() != null) { + successThreshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorTestConfiguration.class); +} 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..90c8b544d0396 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..325a40be81e1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor test group. */ +@Fluent +public final class ConnectionMonitorTestGroup { + /* + * The name of the connection monitor test group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Value indicating whether test group is disabled. + */ + @JsonProperty(value = "disable") + private Boolean disable; + + /* + * List of test configuration names. + */ + @JsonProperty(value = "testConfigurations", required = true) + private List testConfigurations; + + /* + * List of source endpoint names. + */ + @JsonProperty(value = "sources", required = true) + private List sources; + + /* + * List of destination endpoint names. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ConnectionMonitorTestGroup")); + } + if (testConfigurations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property testConfigurations in model ConnectionMonitorTestGroup")); + } + if (sources() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sources in model ConnectionMonitorTestGroup")); + } + if (destinations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinations in model ConnectionMonitorTestGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorTestGroup.class); +} 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..dc12761ed9a76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..a31ef56dd26fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the settings for producing output into a log analytics workspace. */ +@Fluent +public final class ConnectionMonitorWorkspaceSettings { + /* + * Log analytics workspace resource ID. + */ + @JsonProperty(value = "workspaceResourceId") + 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() { + } +} 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..62f9215594a44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ConnectionMonitors. */ +public interface ConnectionMonitors { + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..ec3a252088bd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; + +/** An immutable client-side representation of ConnectionResetSharedKey. */ +public interface ConnectionResetSharedKey { + /** + * Gets the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value. + */ + int keyLength(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner object. + * + * @return the inner object. + */ + ConnectionResetSharedKeyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java new file mode 100644 index 0000000000000..40bc291b7d9d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** An immutable client-side representation of ConnectionSharedKey. */ +public interface ConnectionSharedKey { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the value property: The virtual network connection shared key value. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner object. + * + * @return the inner object. + */ + ConnectionSharedKeyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java new file mode 100644 index 0000000000000..cfd45d0404bec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..3b35a34e671d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Connection state snapshot. */ +@Fluent +public final class ConnectionStateSnapshot { + /* + * The connection state. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /* + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Connectivity analysis evaluation state. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /* + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Long avgLatencyInMs; + + /* + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Long minLatencyInMs; + + /* + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Long maxLatencyInMs; + + /* + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Long probesSent; + + /* + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Long probesFailed; + + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** 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()); + } + } +} 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..d1da45aa89443 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..f715dfff18acf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfiguration.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.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 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..d0fa520cc464b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of Connectivity Configurations + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next page of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..95c3c0b2a3e15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurations.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.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..844b3479819d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.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.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define destination of connection. */ +@Fluent +public final class ConnectivityDestination { + /* + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The IP address or URI the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** 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() { + } +} 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..7e3654159c488 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityGroupItem.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Connectivity group item. */ +@Fluent +public final class ConnectivityGroupItem { + /* + * Network group Id. + */ + @JsonProperty(value = "networkGroupId", required = true) + private String networkGroupId; + + /* + * Flag if need to use hub gateway. + */ + @JsonProperty(value = "useHubGateway") + private UseHubGateway useHubGateway; + + /* + * Flag if global is supported. + */ + @JsonProperty(value = "isGlobal") + private IsGlobal isGlobal; + + /* + * Group connectivity type. + */ + @JsonProperty(value = "groupConnectivity", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkGroupId in model ConnectivityGroupItem")); + } + if (groupConnectivity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property groupConnectivity in model ConnectivityGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityGroupItem.class); +} 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..5cf3efe920b0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about a hop between the source and the destination. */ +@Immutable +public final class ConnectivityHop { + /* + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /* + * List of previous hop identifiers. + */ + @JsonProperty(value = "previousHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List previousHopIds; + + /* + * List of hop links. + */ + @JsonProperty(value = "links", access = JsonProperty.Access.WRITE_ONLY) + private List links; + + /* + * List of previous hop links. + */ + @JsonProperty(value = "previousLinks", access = JsonProperty.Access.WRITE_ONLY) + private List previousLinks; + + /* + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java new file mode 100644 index 0000000000000..a171e7acede86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import java.util.List; + +/** An immutable client-side representation of ConnectivityInformation. */ +public interface ConnectivityInformation { + /** + * Gets the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + List hops(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * Gets the avgLatencyInMs property: Average latency in milliseconds. + * + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * Gets the minLatencyInMs property: Minimum latency in milliseconds. + * + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * Gets the maxLatencyInMs property: Maximum latency in milliseconds. + * + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * Gets the probesSent property: Total number of probes sent. + * + * @return the probesSent value. + */ + Integer probesSent(); + + /** + * Gets the probesFailed property: Number of failed probes. + * + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner object. + * + * @return the inner object. + */ + ConnectivityInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java new file mode 100644 index 0000000000000..1df51680de41d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about an issue encountered in the process of checking for connectivity. */ +@Immutable +public final class ConnectivityIssue { + /* + * The origin of the issue. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * The severity of the issue. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /* + * The type of issue. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /* + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** 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() { + } +} 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..264762c5c6e69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.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.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that determine how the connectivity check will be performed. */ +@Fluent +public final class ConnectivityParameters { + /* + * The source of the connection. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /* + * The destination of connection. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /* + * Network protocol. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /* + * Configuration of the protocol. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /* + * Preferred IP version of the connection. + */ + @JsonProperty(value = "preferredIPVersion") + private IpVersion preferredIpVersion; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ConnectivityParameters")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model ConnectivityParameters")); + } else { + destination().validate(); + } + if (protocolConfiguration() != null) { + protocolConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityParameters.class); +} 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..39155a0412be6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the source of the connection. */ +@Fluent +public final class ConnectivitySource { + /* + * The ID of the resource from which a connectivity check will be initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model ConnectivitySource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivitySource.class); +} 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..abb60b1c7edb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityTopology.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..1b16367393671 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; + +/** 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() { + } +} 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..e491a11596f52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfacePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface child resource. */ +@Fluent +public final class ContainerNetworkInterface extends SubResource { + /* + * Container network interface properties. + */ + @JsonProperty(value = "properties") + private ContainerNetworkInterfacePropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..d6b6b386e02e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceConfigurationPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface configuration child resource. */ +@Fluent +public final class ContainerNetworkInterfaceConfiguration extends SubResource { + /* + * Container network interface configuration properties. + */ + @JsonProperty(value = "properties") + private ContainerNetworkInterfaceConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..181465036bd4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ip configuration for a container network interface. */ +@Fluent +public final class ContainerNetworkInterfaceIpConfiguration { + /* + * Properties of the container network interface IP configuration. + */ + @JsonProperty(value = "properties") + private ContainerNetworkInterfaceIpConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..5825ecef68b2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a3c1b29d7c28a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Criterion.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A matching criteria which matches routes based on route prefix, community, and AS path. */ +@Fluent +public final class Criterion { + /* + * List of route prefixes which this criteria matches. + */ + @JsonProperty(value = "routePrefix") + private List routePrefix; + + /* + * List of BGP communities which this criteria matches. + */ + @JsonProperty(value = "community") + private List community; + + /* + * List of AS paths which this criteria matches. + */ + @JsonProperty(value = "asPath") + private List asPath; + + /* + * Match condition to apply RouteMap rules. + */ + @JsonProperty(value = "matchCondition") + 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() { + } +} 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..a2eb25cdadeec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CrossTenantScopes.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cross tenant scopes. */ +@Immutable +public final class CrossTenantScopes { + /* + * Tenant ID. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * List of management groups. + */ + @JsonProperty(value = "managementGroups", access = JsonProperty.Access.WRITE_ONLY) + private List managementGroups; + + /* + * List of subscriptions. + */ + @JsonProperty(value = "subscriptions", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..f667daa347719 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains custom Dns resolution configuration from customer. */ +@Fluent +public final class CustomDnsConfigPropertiesFormat { + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * A list of private ip addresses of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** 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() { + } +} 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..dc7de6235c1c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..7aedb0defb206 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListCustomIpPrefixes API service call. */ +@Fluent +public final class CustomIpPrefixListResult { + /* + * A list of Custom IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..dc134b81dbd73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..2c516e065b475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CustomIpPrefixes. */ +public interface CustomIpPrefixes { + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String customIpPrefixName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @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..4580a54099165 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DdosCustomPolicies. */ +public interface DdosCustomPolicies { + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..7f92707d0dafe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.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.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..5407d6fb4ccf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..4927838452807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of DDoS protection plans. */ +@Fluent +public final class DdosProtectionPlanListResult { + /* + * A list of DDoS protection plans. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..5ca56b913b219 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DdosProtectionPlans. */ +public interface DdosProtectionPlans { + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..8932923c64b55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the DDoS protection settings of the public IP. */ +@Fluent +public final class DdosSettings { + /* + * The DDoS protection mode of the public IP + */ + @JsonProperty(value = "protectionMode") + private DdosSettingsProtectionMode protectionMode; + + /* + * The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled + */ + @JsonProperty(value = "ddosProtectionPlan") + 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() { + } +} 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..22724d1899bd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..abe646dc1a7f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultAdminRule.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.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network default admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Default") +@Fluent +public final class DefaultAdminRule extends BaseAdminRuleInner { + /* + * Indicates the properties of the security admin rule + */ + @JsonProperty(value = "properties") + private DefaultAdminPropertiesFormat innerProperties; + + /** Creates an instance of DefaultAdminRule class. */ + public DefaultAdminRule() { + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private DefaultAdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..8f03045b7632a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DefaultSecurityRules. */ +public interface DefaultSecurityRules { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group 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..c4eed4352abbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceDelegationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details the service to which the subnet is delegated. */ +@Fluent +public final class Delegation extends SubResource { + /* + * Properties of the subnet. + */ + @JsonProperty(value = "properties") + private ServiceDelegationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a subnet. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** 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(); + } + } +} 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..16dbd948d0020 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DelegationProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the delegation. */ +@Fluent +public final class DelegationProperties { + /* + * The service name to which the NVA is delegated. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * The current provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..3e0f37709345c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteExistingPeering.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..c8ff1c51a903a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..d54a7b46d3ee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeploymentStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..1dd2cb50daebf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..01be812fa04a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of properties of the device. */ +@Fluent +public final class DeviceProperties { + /* + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /* + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** 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() { + } +} 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..f40c27515839d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..6174a5d29f2e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option + * for a subnet overrides VNET DHCP options. + */ +@Fluent +public final class DhcpOptions { + /* + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + 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() { + } +} 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..2d61a368c8661 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimension of the metric. */ +@Fluent +public final class Dimension { + /* + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** 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() { + } +} 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..750befa001799 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/DnsNameAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java new file mode 100644 index 0000000000000..f6bbf2df973c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; + +/** An immutable client-side representation of DnsNameAvailabilityResult. */ +public interface DnsNameAvailabilityResult { + /** + * Gets the available property: Domain availability (True/False). + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner object. + * + * @return the inner object. + */ + DnsNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java new file mode 100644 index 0000000000000..83970a65b69aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS Proxy Settings in Firewall Policy. */ +@Fluent +public final class DnsSettings { + /* + * List of Custom DNS Servers. + */ + @JsonProperty(value = "servers") + private List servers; + + /* + * Enable DNS Proxy on Firewalls attached to the Firewall Policy. + */ + @JsonProperty(value = "enableProxy") + private Boolean enableProxy; + + /* + * FQDNs in Network Rules are supported when set to true. + */ + @JsonProperty(value = "requireProxyForNetworkRules") + private Boolean requireProxyForNetworkRules; + + /** 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() { + } +} 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..de75e30feff7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.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.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..8321b9b8d747a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the DscpConfigurationList API service call. */ +@Fluent +public final class DscpConfigurationListResult { + /* + * A list of dscp configurations in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..1489bfc5cebbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DscpConfigurations. */ +public interface DscpConfigurations { + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..a19eea267897d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveAdminRuleKind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..7cf9dc0d8733a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveBaseSecurityAdminRule.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.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network base admin rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = EffectiveBaseSecurityAdminRule.class) +@JsonTypeName("EffectiveBaseSecurityAdminRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Custom", value = EffectiveSecurityAdminRule.class), + @JsonSubTypes.Type(name = "Default", value = EffectiveDefaultSecurityAdminRule.class) +}) +@Fluent +public class EffectiveBaseSecurityAdminRule { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * A description of the security admin configuration. + */ + @JsonProperty(value = "configurationDescription") + private String configurationDescription; + + /* + * A description of the rule collection. + */ + @JsonProperty(value = "ruleCollectionDescription") + private String ruleCollectionDescription; + + /* + * Groups for rule collection + */ + @JsonProperty(value = "ruleCollectionAppliesToGroups") + private List ruleCollectionAppliesToGroups; + + /* + * Effective configuration groups. + */ + @JsonProperty(value = "ruleGroups") + private List ruleGroups; + + /** Creates an instance of EffectiveBaseSecurityAdminRule class. */ + public EffectiveBaseSecurityAdminRule() { + } + + /** + * 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()); + } + } +} 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..bc7a3870bd65e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveConnectivityConfiguration.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.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network manager effective connectivity configuration. */ +@Fluent +public class EffectiveConnectivityConfiguration { + /* + * Connectivity configuration ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Properties of a network manager connectivity configuration + */ + @JsonProperty(value = "properties") + private ConnectivityConfigurationProperties innerProperties; + + /* + * Effective configuration groups. + */ + @JsonProperty(value = "configurationGroups") + 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; + } + + /** + * 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; + } + + /** + * 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()); + } + } +} 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..82aa4706a065b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveDefaultSecurityAdminRule.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.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network default admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Default") +@Fluent +public final class EffectiveDefaultSecurityAdminRule extends EffectiveBaseSecurityAdminRule { + /* + * Indicates the properties of the default security admin rule + */ + @JsonProperty(value = "properties") + private DefaultAdminPropertiesFormat innerProperties; + + /** Creates an instance of EffectiveDefaultSecurityAdminRule class. */ + public EffectiveDefaultSecurityAdminRule() { + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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..a3269c47290e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective network security group. */ +@Fluent +public final class EffectiveNetworkSecurityGroup { + /* + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /* + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /* + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private String tagMap; + + /** 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()); + } + } +} 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..306966df39939 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The effective network security group association. */ +@Fluent +public final class EffectiveNetworkSecurityGroupAssociation { + /* + * The ID of the Azure network manager if assigned. + */ + @JsonProperty(value = "networkManager") + private SubResource networkManager; + + /* + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..d11a4d350adf0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveNetworkSecurityGroupListResult. */ +public interface EffectiveNetworkSecurityGroupListResult { + /** + * Gets the value property: A list of effective network security groups. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner object. + * + * @return the inner object. + */ + EffectiveNetworkSecurityGroupListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..d3379280489fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective network security rules. */ +@Fluent +public final class EffectiveNetworkSecurityRule { + /* + * The name of the security rule specified by the user (if created by the user). + */ + @JsonProperty(value = "name") + private String name; + + /* + * The network protocol this rule applies to. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /* + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /* + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /* + * The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as + * separator (e.g. 100-400), or an asterisk (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as + * separator (e.g. 100-400), or an asterisk (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /* + * The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /* + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /* + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /* + * Whether network traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /* + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The direction of the rule. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** 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() { + } +} 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..4d4ba4b2f93f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective Route. */ +@Fluent +public final class EffectiveRoute { + /* + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /* + * If true, on-premises routes are not propagated to the network interfaces in the subnet. + */ + @JsonProperty(value = "disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /* + * Who created the route. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /* + * The value of effective route. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /* + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /* + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /* + * The type of Azure hop the packet should be sent to. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..c956b9188cc9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveRouteListResult. */ +public interface EffectiveRouteListResult { + /** + * Gets the value property: A list of effective routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner object. + * + * @return the inner object. + */ + EffectiveRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java new file mode 100644 index 0000000000000..6016ccefc4a0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..a1d6b37d5b941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..8eeef5ed0f668 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters specifying the resource whose effective routes are being requested. */ +@Fluent +public final class EffectiveRoutesParameters { + /* + * The resource whose effective routes are being requested. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + @JsonProperty(value = "virtualWanResourceType") + private String virtualWanResourceType; + + /** 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() { + } +} 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..1181bb46e2cf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Network admin rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Custom") +@Fluent +public final class EffectiveSecurityAdminRule extends EffectiveBaseSecurityAdminRule { + /* + * Indicates the properties of the security admin rule + */ + @JsonProperty(value = "properties") + private AdminPropertiesFormat innerProperties; + + /** Creates an instance of EffectiveSecurityAdminRule class. */ + public EffectiveSecurityAdminRule() { + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..3df30eee56221 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..917886e1f7f53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; + +/** An immutable client-side representation of EndpointServiceResult. */ +public interface EndpointServiceResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the endpoint service. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the endpoint service. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner object. + * + * @return the inner object. + */ + EndpointServiceResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java new file mode 100644 index 0000000000000..2de3b0a6a243d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListAvailableEndpointServices API service call. */ +@Fluent +public final class EndpointServicesListResult { + /* + * List of available endpoint services in a region. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..483d22fc00183 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..f3ddbe786804a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common error representation. */ +@Immutable +public final class Error extends ManagementError { + /* + * Inner error message. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private String innerError; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java new file mode 100644 index 0000000000000..e823b22e6bb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.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.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..31c6bff8aa9b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Results of network security group evaluation. */ +@Fluent +public final class EvaluatedNetworkSecurityGroup { + /* + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /* + * Resource ID of nic or subnet to which network security group is applied. + */ + @JsonProperty(value = "appliedTo") + private String appliedTo; + + /* + * Matched network security rule. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /* + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** 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()); + } + } +} 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..a657a16de6fcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..5cc0c89dd1170 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule to use for exclusion. */ +@Fluent +public final class ExclusionManagedRule { + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ExclusionManagedRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExclusionManagedRule.class); +} 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..1e91e099aa189 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group to use for exclusion. */ +@Fluent +public final class ExclusionManagedRuleGroup { + /* + * The managed rule group for exclusion. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * List of rules that will be excluded. If none specified, all rules in the group will be excluded. + */ + @JsonProperty(value = "rules") + 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 + .logExceptionAsError( + 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); +} 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..54ccbbe231aaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set for Exclusions. */ +@Fluent +public final class ExclusionManagedRuleSet { + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the rule groups to apply to the rule set. + */ + @JsonProperty(value = "ruleGroups") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model ExclusionManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + 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); +} 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..1cd838de67216 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxy.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.fasterxml.jackson.annotation.JsonProperty; + +/** Explicit Proxy Settings in Firewall Policy. */ +@Fluent +public final class ExplicitProxy { + /* + * When set to true, explicit proxy mode is enabled. + */ + @JsonProperty(value = "enableExplicitProxy") + private Boolean enableExplicitProxy; + + /* + * Port number for explicit proxy http protocol, cannot be greater than 64000. + */ + @JsonProperty(value = "httpPort") + private Integer httpPort; + + /* + * Port number for explicit proxy https protocol, cannot be greater than 64000. + */ + @JsonProperty(value = "httpsPort") + private Integer httpsPort; + + /* + * When set to true, pac file port and url needs to be provided. + */ + @JsonProperty(value = "enablePacFile") + private Boolean enablePacFile; + + /* + * Port number for firewall to serve PAC file. + */ + @JsonProperty(value = "pacFilePort") + private Integer pacFilePort; + + /* + * SAS URL for PAC file. + */ + @JsonProperty(value = "pacFile") + 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() { + } +} 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..da50499999d12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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..bc84c3247cbea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ARP table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitArpTable { + /* + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /* + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /* + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** 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() { + } +} 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..e13f613f53434 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.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.ExpressRouteCircuitAuthorizationInner; + +/** An immutable client-side representation of ExpressRouteCircuitAuthorization. */ +public interface ExpressRouteCircuitAuthorization { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the 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..34a2a666c55ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuitAuthorizations. */ +public interface ExpressRouteCircuitAuthorizations { + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..f66805f854192 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.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.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..075d108dbf475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListConnections API service call retrieves all global reach connections that belongs to a Private + * Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitConnectionListResult { + /* + * The global reach connection associated with Private Peering in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..9fd6ebcbce167 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.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 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..611bcd991054c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCircuit API service call. */ +@Fluent +public final class ExpressRouteCircuitListResult { + /* + * A list of ExpressRouteCircuits in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..3b56cf36864e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..6cbfba81b31e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..144b3bd90acf8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the peering configuration. */ +@Fluent +public final class ExpressRouteCircuitPeeringConfig { + /* + * The reference to AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /* + * The communities of bgp peering. Specified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /* + * The advertised public prefix state of the Peering resource. + */ + @JsonProperty(value = "advertisedPublicPrefixesState", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /* + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /* + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerAsn; + + /* + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** 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() { + } +} 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..803423ed1ac24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoute circuit peering identifier. */ +@Fluent +public final class ExpressRouteCircuitPeeringId { + /* + * The ID of the ExpressRoute circuit peering. + */ + @JsonProperty(value = "id") + 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() { + } +} 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..0676ba83edf42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitPeeringListResult { + /* + * The peerings in an express route circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..1e4e5b7679b99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringPropertiesFormat.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.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..bc71d90af818e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..e2f1de945925f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuitPeerings. */ +public interface ExpressRouteCircuitPeerings { + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String peeringName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..4ee95e39dcfbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to an express route circuit. */ +@Fluent +public final class ExpressRouteCircuitReference { + /* + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "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() { + } +} 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..7f2e26334a845 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.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.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTable { + /* + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /* + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /* + * Local preference value as set with the set local-preference route-map configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /* + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** 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() { + } +} 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..cbce7ee6c73b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTableSummary { + /* + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /* + * The length of time that the BGP session has been in the Established state, or the current status if not in the + * Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer + * group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** 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() { + } +} 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..050de5fd006ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains ServiceProviderProperties in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitServiceProviderProperties { + /* + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /* + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** 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() { + } +} 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..573dd081e3693 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains SKU in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitSku { + /* + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The tier of the SKU. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /* + * The family of the SKU. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** 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() { + } +} 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..ee6cf9cbb50a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..8e8714bcf2d52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..671681671b22d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; + +/** An immutable client-side representation of ExpressRouteCircuitStats. */ +public interface ExpressRouteCircuitStats { + /** + * Gets the primarybytesIn property: The Primary BytesIn of the peering. + * + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * Gets the primarybytesOut property: The primary BytesOut of the peering. + * + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * Gets the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * Gets the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitStatsInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..fee37c3bb2315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuits. */ +public interface ExpressRouteCircuits { + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, Context context); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..25e6466bb5e15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsArpTableListResult. */ +public interface ExpressRouteCircuitsArpTableListResult { + /** + * Gets the value property: A list of the ARP tables. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitsArpTableListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 0000000000000..250b2134d9cc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsRoutesTableListResult. */ +public interface ExpressRouteCircuitsRoutesTableListResult { + /** + * Gets the value property: The list of routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitsRoutesTableListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..a99488a7585d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitsRoutesTableSummaryListResult. */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult { + /** + * Gets the value property: A list of the routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitsRoutesTableSummaryListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java new file mode 100644 index 0000000000000..37bbf2a487eb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.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.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..569bb5a49311d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ID of the ExpressRouteConnection. */ +@Immutable +public final class ExpressRouteConnectionId { + /* + * The ID of the ExpressRouteConnection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java new file mode 100644 index 0000000000000..0e014f16c54b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteConnectionList. */ +public interface ExpressRouteConnectionList { + /** + * Gets the value property: The list of ExpressRoute connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner object. + * + * @return the inner object. + */ + ExpressRouteConnectionListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java new file mode 100644 index 0000000000000..01eb89b2a355f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; + +/** Resource collection API of ExpressRouteConnections. */ +public interface ExpressRouteConnections { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..f61074f74ff20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.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.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..54d36ac896a83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCrossConnection API service call. */ +@Fluent +public final class ExpressRouteCrossConnectionListResult { + /* + * A list of ExpressRouteCrossConnection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..a659710ea0fe4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** An immutable client-side representation of ExpressRouteCrossConnectionPeering. */ +public interface ExpressRouteCrossConnectionPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the peeringType property: The peering type. + * + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * Gets the state property: The peering state. + * + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * Gets the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + Integer azureAsn(); + + /** + * Gets the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * Gets the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * Gets the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * Gets the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * Gets the provisioningState property: The provisioning state of the express route cross connection peering + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * Gets the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner + * object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionPeeringInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java new file mode 100644 index 0000000000000..d381e2e85d2d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringList { + /* + * The peerings in an express route cross connection. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..847eed660c638 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** Resource collection API of ExpressRouteCrossConnectionPeerings. */ +public interface ExpressRouteCrossConnectionPeerings { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection 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..98ce03e69c078 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCrossConnectionRoutesTableSummary { + /* + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /* + * The length of time that the BGP session has been in the Established state, or the current status if not in the + * Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer + * group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** 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() { + } +} 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..eba68664a9569 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.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.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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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(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..3fc4c85573dd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCrossConnectionsRoutesTableSummaryListResult. */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + /** + * Gets the value property: A list of the routes table. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner + * object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java new file mode 100644 index 0000000000000..849b237ed4ac5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.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..56d586f2676c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteGatewayList. */ +public interface ExpressRouteGatewayList { + /** + * Gets the value property: List of ExpressRoute gateways. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner object. + * + * @return the inner object. + */ + ExpressRouteGatewayListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java new file mode 100644 index 0000000000000..21ba9a75e455b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for auto scaling. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfiguration { + /* + * Minimum and maximum number of scale units to deploy. + */ + @JsonProperty(value = "bounds") + 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(); + } + } +} 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..4f048c05a8d92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Minimum and maximum number of scale units to deploy. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + /* + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "min") + private Integer min; + + /* + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "max") + private Integer max; + + /** 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() { + } +} 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..646af8b1ec3cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteGateways. */ +public interface ExpressRouteGateways { + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..9132293c91832 --- /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: Definition of ExpressRouteLink Mac Security configuration. + * + *

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..a66dbfd2524ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..e709757b36377 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..97cb536ff172d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRouteLink List Result + * + *

Response for ListExpressRouteLinks API service call. + */ +@Fluent +public final class ExpressRouteLinkListResult { + /* + * The list of ExpressRouteLink sub-resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..a1dfa7d54cc0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..fe0d8f7bb7ed9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Definition of ExpressRouteLink Mac Security configuration. + * + *

ExpressRouteLink Mac Security Configuration. + */ +@Fluent +public final class ExpressRouteLinkMacSecConfig { + /* + * Keyvault Secret Identifier URL containing Mac security CKN key. + */ + @JsonProperty(value = "cknSecretIdentifier") + private String cknSecretIdentifier; + + /* + * Keyvault Secret Identifier URL containing Mac security CAK key. + */ + @JsonProperty(value = "cakSecretIdentifier") + private String cakSecretIdentifier; + + /* + * Mac security cipher. + */ + @JsonProperty(value = "cipher") + private ExpressRouteLinkMacSecCipher cipher; + + /* + * Sci mode enabled/disabled. + */ + @JsonProperty(value = "sciState") + private ExpressRouteLinkMacSecSciState sciState; + + /** 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() { + } +} 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..b6df633d993bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..6d22949c5fb1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteLinks. */ +public interface ExpressRouteLinks { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..3e04c349536ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..4648b1ec3c66a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..51928ae90308e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.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.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: ExpressRouteLink Sub-Resources + * + *

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: ExpressRouteLink Sub-Resources + * + *

The set of physical links of the ExpressRoutePort resource.. + * + * @param links ExpressRouteLink Sub-Resources + *

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..3850080098878 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorization.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..00ca7e73f1dc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRoute Port Authorization List Result + * + *

Response for ListExpressRoutePortAuthorizations API service call. + */ +@Fluent +public final class ExpressRoutePortAuthorizationListResult { + /* + * The authorizations in an ExpressRoute Port. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..994d344d25c98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..99591f87e729d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizations.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 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..e58d258878cd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRoute Port List Result + * + *

Response for ListExpressRoutePorts API service call. + */ +@Fluent +public final class ExpressRoutePortListResult { + /* + * A list of ExpressRoutePort resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..8070cd43dca62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRoutePorts. */ +public interface ExpressRoutePorts { + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..6f69914e6d30e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsBillingType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..c2ceaad4061e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..7cd1a488ed340 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRoutePortsLocation. */ +public interface ExpressRoutePortsLocation { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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..35ddc89303fc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoutePorts Location Bandwidths + * + *

Real-time inventory of available ExpressRoute port bandwidths. + */ +@Immutable +public final class ExpressRoutePortsLocationBandwidths { + /* + * Bandwidth descriptive name. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /* + * Bandwidth value in Gbps. + */ + @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer valueInGbps; + + /** 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() { + } +} 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..f2c4e725f6470 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ExpressRoutePorts Location List Result + * + *

Response for ListExpressRoutePortsLocations API service call. + */ +@Fluent +public final class ExpressRoutePortsLocationListResult { + /* + * The list of all ExpressRoutePort peering locations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..8392de6f59a90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRoutePortsLocations. */ +public interface ExpressRoutePortsLocations { + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..51b5357cf2e34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPort.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.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..c78703b833d61 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortListResult.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.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..583c10f3a257a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortsLocations.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..4b073000b14c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteServiceProvider. */ +public interface ExpressRouteServiceProvider { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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..445b47c39eb22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains bandwidths offered in ExpressRouteServiceProvider resources. */ +@Fluent +public final class ExpressRouteServiceProviderBandwidthsOffered { + /* + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /* + * The ValueInMbps. + */ + @JsonProperty(value = "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() { + } +} 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..e964b62f4993b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListExpressRouteServiceProvider API service call. */ +@Fluent +public final class ExpressRouteServiceProviderListResult { + /* + * A list of ExpressRouteResourceProvider resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..9d3abbc8f039f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteServiceProviders. */ +public interface ExpressRouteServiceProviders { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers 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..ebdba1e9616f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExtendedLocation complex type. */ +@Fluent +public final class ExtendedLocation { + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..9138a21827c19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..8684c14c279ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FilterItems.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Will contain the filter name and values to operate on. */ +@Fluent +public final class FilterItems { + /* + * The name of the field we would like to filter + */ + @JsonProperty(value = "field") + private String field; + + /* + * List of values to filter the current field by + */ + @JsonProperty(value = "values") + 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() { + } +} 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..eb5eb49607e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FirewallPolicies. */ +public interface FirewallPolicies { + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @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..840c9236992ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.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.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 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..0a1b1d8c66a81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates properties for tls. */ +@Fluent +public final class FirewallPolicyCertificateAuthority { + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /* + * Name of the CA certificate. + */ + @JsonProperty(value = "name") + private String name; + + /** 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() { + } +} 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..92b2c03152895 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Firewall Policy Filter Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyFilterRuleCollection") +@Fluent +public final class FirewallPolicyFilterRuleCollection extends FirewallPolicyRuleCollection { + /* + * The action type of a Filter rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyFilterRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of FirewallPolicyFilterRuleCollection class. */ + public FirewallPolicyFilterRuleCollection() { + } + + /** + * Get the action property: The action type of a Filter rule collection. + * + * @return the action value. + */ + public FirewallPolicyFilterRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Filter rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withAction(FirewallPolicyFilterRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java new file mode 100644 index 0000000000000..3a27792fb9125 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the FirewallPolicyFilterRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyFilterRuleCollectionAction { + /* + * The type of action. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..f63807208ab76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..d4136b6f38f2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsQuerySortOrder.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..dd3084192baa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureDirection.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional. */ +public enum FirewallPolicyIdpsSignatureDirection { + /** Enum value 0. */ + ZERO(0), + + /** Enum value 1. */ + ONE(1), + + /** Enum value 2. */ + TWO(2); + + /** 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. + */ + @JsonCreator + 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. + */ + @JsonValue + 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..bbe9bde4613d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureMode.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** 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. + */ + @JsonCreator + 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. + */ + @JsonValue + 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..669c0567ad200 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureSeverity.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High. */ +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. + */ + @JsonCreator + 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. + */ + @JsonValue + 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..6e7ab42863b68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatures.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FirewallPolicyIdpsSignatures. */ +public interface FirewallPolicyIdpsSignatures { + /** + * Retrieves the current status of IDPS signatures for the relevant policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will describe the query to run against the IDPS signatures DB. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..0dcb4b6d780cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesFilterValues.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 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 Describes the filter values possibles for a given column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Describes the filter values possibles for a given column. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..1514cb589ac30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesOverrides.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.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..c943b62e5c58f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyInsights { + /* + * A flag to indicate if the insights are enabled on the policy. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Number of days the insights should be enabled on the policy. + */ + @JsonProperty(value = "retentionDays") + private Integer retentionDays; + + /* + * Workspaces needed to configure the Firewall Policy Insights. + */ + @JsonProperty(value = "logAnalyticsResources") + private FirewallPolicyLogAnalyticsResources logAnalyticsResources; + + /** 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(); + } + } +} 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..c14df339e5b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for intrusion detection mode and rules. */ +@Fluent +public final class FirewallPolicyIntrusionDetection { + /* + * Intrusion detection general state. + */ + @JsonProperty(value = "mode") + private FirewallPolicyIntrusionDetectionStateType mode; + + /* + * Intrusion detection configuration properties. + */ + @JsonProperty(value = "configuration") + private FirewallPolicyIntrusionDetectionConfiguration configuration; + + /** Creates an instance of FirewallPolicyIntrusionDetection class. */ + public FirewallPolicyIntrusionDetection() { + } + + /** + * Get the mode property: Intrusion detection general state. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: Intrusion detection general state. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withMode(FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Get the configuration property: Intrusion detection configuration properties. + * + * @return the configuration value. + */ + public FirewallPolicyIntrusionDetectionConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Intrusion detection configuration properties. + * + * @param configuration the configuration value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withConfiguration( + FirewallPolicyIntrusionDetectionConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java new file mode 100644 index 0000000000000..853fcc4904520 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Intrusion detection bypass traffic specification. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications { + /* + * Name of the bypass traffic rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the bypass traffic rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rule bypass protocol. + */ + @JsonProperty(value = "protocol") + private FirewallPolicyIntrusionDetectionProtocol protocol; + + /* + * List of source IP addresses or ranges for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or ranges for this rule. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports or ranges. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** 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() { + } +} 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..6645985cb6a91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The operation for configuring intrusion detection. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionConfiguration { + /* + * List of specific signatures states. + */ + @JsonProperty(value = "signatureOverrides") + private List signatureOverrides; + + /* + * List of rules for traffic to bypass. + */ + @JsonProperty(value = "bypassTrafficSettings") + 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 + */ + @JsonProperty(value = "privateRanges") + 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()); + } + } +} 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..0ab24638b31d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a73cafdd0eefa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.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.fasterxml.jackson.annotation.JsonProperty; + +/** Intrusion detection signatures specification states. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionSignatureSpecification { + /* + * Signature id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The signature state. + */ + @JsonProperty(value = "mode") + 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() { + } +} 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..208e8bcf1ad11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..cc756910b9034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicies API service call. */ +@Fluent +public final class FirewallPolicyListResult { + /* + * List of Firewall Policies in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..84de20d632611 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Log Analytics Resources for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsResources { + /* + * List of workspaces for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaces") + private List workspaces; + + /* + * The default workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "defaultWorkspaceId") + private SubResource defaultWorkspaceId; + + /** 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()); + } + } +} 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..17e5a5df973f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Analytics Workspace for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsWorkspace { + /* + * Region to configure the Workspace. + */ + @JsonProperty(value = "region") + private String region; + + /* + * The workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaceId") + 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() { + } +} 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..47e67db9288f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Firewall Policy NAT Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyNatRuleCollection") +@Fluent +public final class FirewallPolicyNatRuleCollection extends FirewallPolicyRuleCollection { + /* + * The action type of a Nat rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyNatRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of FirewallPolicyNatRuleCollection class. */ + public FirewallPolicyNatRuleCollection() { + } + + /** + * Get the action property: The action type of a Nat rule collection. + * + * @return the action value. + */ + public FirewallPolicyNatRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Nat rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withAction(FirewallPolicyNatRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java new file mode 100644 index 0000000000000..0a12c39d2149f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the FirewallPolicyNatRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyNatRuleCollectionAction { + /* + * The type of action. + */ + @JsonProperty(value = "type") + 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() { + } +} 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..b1ff2d1fd6387 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..19226c0e0e1ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleType", + defaultImpl = FirewallPolicyRule.class) +@JsonTypeName("FirewallPolicyRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApplicationRule", value = ApplicationRule.class), + @JsonSubTypes.Type(name = "NatRule", value = NatRule.class), + @JsonSubTypes.Type(name = "NetworkRule", value = NetworkRule.class) +}) +@Fluent +public class FirewallPolicyRule { + /* + * Name of the rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of FirewallPolicyRule class. */ + public FirewallPolicyRule() { + } + + /** + * Get the name property: Name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rule. + * + * @param name the name value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java new file mode 100644 index 0000000000000..1e6e207c78ee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the application rule protocol. */ +@Fluent +public final class FirewallPolicyRuleApplicationProtocol { + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private FirewallPolicyRuleApplicationProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. + */ + @JsonProperty(value = "port") + 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() { + } +} 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..3cc1186e265c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..3be2e963f54e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of the rule collection. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleCollectionType", + defaultImpl = FirewallPolicyRuleCollection.class) +@JsonTypeName("FirewallPolicyRuleCollection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FirewallPolicyNatRuleCollection", value = FirewallPolicyNatRuleCollection.class), + @JsonSubTypes.Type(name = "FirewallPolicyFilterRuleCollection", value = FirewallPolicyFilterRuleCollection.class) +}) +@Fluent +public class FirewallPolicyRuleCollection { + /* + * The name of the rule collection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Priority of the Firewall Policy Rule Collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** Creates an instance of FirewallPolicyRuleCollection class. */ + public FirewallPolicyRuleCollection() { + } + + /** + * Get the name property: The name of the rule collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the rule collection. + * + * @param name the name value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @param priority the priority value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java new file mode 100644 index 0000000000000..bebfedbbe3e55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import java.util.List; + +/** An immutable client-side representation of FirewallPolicyRuleCollectionGroup. */ +public interface FirewallPolicyRuleCollectionGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Rule Group type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + List ruleCollections(); + + /** + * Gets the provisioningState property: The provisioning state of the firewall policy rule collection group + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the 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/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..867a44bcf9b82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicyRuleCollectionGroups API service call. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupListResult { + /* + * List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..2e6d5497a9d81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.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 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..497827382f74b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..5e99ca585671a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..8409482272ae2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..04ae76c9b7a11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of Firewall policy. */ +@Fluent +public final class FirewallPolicySku { + /* + * Tier of Firewall Policy. + */ + @JsonProperty(value = "tier") + 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() { + } +} 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..113d8f03f3ba5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..fa00f676ab296 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private IP addresses/IP ranges to which traffic will not be SNAT. */ +@Fluent +public final class FirewallPolicySnat { + /* + * List of private IP addresses/IP address ranges to not be SNAT. + */ + @JsonProperty(value = "privateRanges") + private List privateRanges; + + /* + * The operation mode for automatically learning private ranges to not be SNAT + */ + @JsonProperty(value = "autoLearnPrivateRanges") + 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() { + } +} 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..fe85c9d3ecb6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySql.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SQL Settings in Firewall Policy. */ +@Fluent +public final class FirewallPolicySql { + /* + * A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port + * 11000-11999. + */ + @JsonProperty(value = "allowSqlRedirect") + 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() { + } +} 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..4991b1320fb2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ThreatIntel Whitelist for Firewall Policy. */ +@Fluent +public final class FirewallPolicyThreatIntelWhitelist { + /* + * List of IP addresses for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /* + * List of FQDNs for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "fqdns") + private List fqdns; + + /** 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() { + } +} 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..e084a32c668c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration needed to perform TLS termination & initiation. */ +@Fluent +public final class FirewallPolicyTransportSecurity { + /* + * The CA used for intermediate CA generation. + */ + @JsonProperty(value = "certificateAuthority") + 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(); + } + } +} 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..4e2319ba65b93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.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.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 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 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.WithTargetResourceId, + DefinitionStages.WithStorageId, + DefinitionStages.WithEnabled, + DefinitionStages.WithRetentionPolicy, + DefinitionStages.WithFormat, + DefinitionStages.WithFlowAnalyticsConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + FlowLog create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FlowLog create(Context context); + } + /** The stage of the FlowLog definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the FlowLog definition allowing to specify targetResourceId. */ + interface WithTargetResourceId { + /** + * Specifies the targetResourceId property: ID of network security group to which flow log will be applied.. + * + * @param targetResourceId ID of network security group to which flow log will be applied. + * @return the next definition stage. + */ + WithCreate withTargetResourceId(String targetResourceId); + } + /** The stage of the FlowLog definition allowing to specify storageId. */ + interface WithStorageId { + /** + * Specifies the storageId property: ID of the storage account which is used to store the flow log.. + * + * @param storageId ID of the storage account which is used to store the flow log. + * @return the next definition stage. + */ + WithCreate withStorageId(String storageId); + } + /** The stage of the FlowLog definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Flag to enable/disable flow logging.. + * + * @param enabled Flag to enable/disable flow logging. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + /** The stage of the FlowLog definition allowing to specify retentionPolicy. */ + interface WithRetentionPolicy { + /** + * Specifies the retentionPolicy property: Parameters that define the retention policy for flow log.. + * + * @param retentionPolicy Parameters that define the retention policy for flow log. + * @return the next definition stage. + */ + WithCreate withRetentionPolicy(RetentionPolicyParameters retentionPolicy); + } + /** The stage of the FlowLog definition allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Parameters that define the flow log format.. + * + * @param format Parameters that define the flow log format. + * @return the next definition stage. + */ + WithCreate withFormat(FlowLogFormatParameters format); + } + /** The stage of the FlowLog definition allowing to specify flowAnalyticsConfiguration. */ + interface WithFlowAnalyticsConfiguration { + /** + * Specifies the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics.. + * + * @param flowAnalyticsConfiguration Parameters that define the configuration of traffic analytics. + * @return the next definition stage. + */ + WithCreate withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration); + } + } + /** + * Begins update for the FlowLog resource. + * + * @return the stage of resource update. + */ + FlowLog.Update update(); + + /** The template for FlowLog update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FlowLog apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FlowLog apply(Context context); + } + /** The FlowLog update stages. */ + interface UpdateStages { + /** The stage of the FlowLog update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FlowLog refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FlowLog refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java new file mode 100644 index 0000000000000..1587a85dbf460 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the flow log format. */ +@Fluent +public final class FlowLogFormatParameters { + /* + * The file type of flow log. + */ + @JsonProperty(value = "type") + private FlowLogFormatType type; + + /* + * The version (revision) of the flow log. + */ + @JsonProperty(value = "version") + private Integer version; + + /** 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() { + } +} 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..da0918b4bc104 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..7e1c0492935c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** An immutable client-side representation of FlowLogInformation. */ +public interface FlowLogInformation { + /** + * Gets the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics + * (optional) . + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * Gets the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + String storageId(); + + /** + * Gets the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + boolean enabled(); + + /** + * Gets the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * Gets the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + FlowLogFormatParameters format(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner object. + * + * @return the inner object. + */ + FlowLogInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java new file mode 100644 index 0000000000000..664c5f6a01478 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of flow logs. */ +@Fluent +public final class FlowLogListResult { + /* + * Information about flow log resource. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..e9be772b878ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define a resource to query flow log and traffic analytics (optional) status. */ +@Fluent +public final class FlowLogStatusParameters { + /* + * The target resource where getting the flow log and traffic analytics (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogStatusParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogStatusParameters.class); +} 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..bcbbe7c04e024 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FlowLogs. */ +public interface FlowLogs { + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..ea9876557a9fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of FrontendIpConfiguration. */ +public interface FrontendIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the inboundNatRules property: An array of references to inbound rules that use this frontend IP. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the inboundNatPools property: An array of references to inbound pools that use this frontend IP. + * + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * Gets the outboundRules property: An array of references to outbound rules that use this frontend IP. + * + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * Gets the loadBalancingRules property: An array of references to load balancing rules that use this frontend IP. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken + * as IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the Public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the publicIpPrefix property: The reference to the Public IP Prefix resource. + * + * @return the publicIpPrefix value. + */ + SubResource publicIpPrefix(); + + /** + * Gets the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + SubResource gatewayLoadBalancer(); + + /** + * Gets the provisioningState property: The provisioning state of the frontend IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner object. + * + * @return the inner object. + */ + FrontendIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..2a9ffd2e77eb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfigurationPropertiesFormat.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.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..02e13f67b0f38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayCustomBgpIpAddressIpConfiguration.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GatewayCustomBgpIpAddressIpConfiguration for a virtual network gateway connection. */ +@Fluent +public final class GatewayCustomBgpIpAddressIpConfiguration { + /* + * The IpconfigurationId of ipconfiguration which belongs to gateway. + */ + @JsonProperty(value = "ipConfigurationId", required = true) + private String ipConfigurationId; + + /* + * The custom BgpPeeringAddress which belongs to IpconfigurationId. + */ + @JsonProperty(value = "customBgpIpAddress", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipConfigurationId in model" + + " GatewayCustomBgpIpAddressIpConfiguration")); + } + if (customBgpIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customBgpIpAddress in model" + + " GatewayCustomBgpIpAddressIpConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayCustomBgpIpAddressIpConfiguration.class); +} 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..e73edf4f300af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway load balancer tunnel interface of a load balancer backend address pool. */ +@Fluent +public final class GatewayLoadBalancerTunnelInterface { + /* + * Port of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Identifier of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "identifier") + private Integer identifier; + + /* + * Protocol of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "protocol") + private GatewayLoadBalancerTunnelProtocol protocol; + + /* + * Traffic type of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "type") + private GatewayLoadBalancerTunnelInterfaceType type; + + /** 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() { + } +} 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..986cc9a098416 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..6927790a02c06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f4e6a8c5bf939 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway routing details. */ +@Immutable +public final class GatewayRoute { + /* + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java new file mode 100644 index 0000000000000..d18816f72f7ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of GatewayRouteListResult. */ +public interface GatewayRouteListResult { + /** + * Gets the value property: List of gateway routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner object. + * + * @return the inner object. + */ + GatewayRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java new file mode 100644 index 0000000000000..c9de0b45dc869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The customer name to be printed on a letter of authorization. */ +@Fluent +public final class GenerateExpressRoutePortsLoaRequest { + /* + * The customer name. + */ + @JsonProperty(value = "customerName", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customerName in model GenerateExpressRoutePortsLoaRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateExpressRoutePortsLoaRequest.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java new file mode 100644 index 0000000000000..c18a19619aa59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; + +/** An immutable client-side representation of GenerateExpressRoutePortsLoaResult. */ +public interface GenerateExpressRoutePortsLoaResult { + /** + * Gets the encodedContent property: The content as a base64 encoded string. + * + * @return the encodedContent value. + */ + String encodedContent(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner + * object. + * + * @return the inner object. + */ + GenerateExpressRoutePortsLoaResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..3b4a6b8df606d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Geo.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..e5154eab3542b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetInboundRoutesParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters specifying the connection resource whose inbound routes are being requested. */ +@Fluent +public final class GetInboundRoutesParameters { + /* + * The connection resource whose inbound routes are being requested. + */ + @JsonProperty(value = "resourceUri") + private String resourceUri; + + /* + * The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + @JsonProperty(value = "connectionType") + 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() { + } +} 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..28d93fb141311 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetOutboundRoutesParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters specifying the connection resource whose outbound routes are being requested. */ +@Fluent +public final class GetOutboundRoutesParameters { + /* + * The connection resource whose outbound routes are being requested. + */ + @JsonProperty(value = "resourceUri") + private String resourceUri; + + /* + * The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + @JsonProperty(value = "connectionType") + 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() { + } +} 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..40ceeeac01942 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Vpn-Sites. */ +@Fluent +public final class GetVpnSitesConfigurationRequest { + /* + * List of resource-ids of the vpn-sites for which config is to be downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /* + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl", required = true) + private String outputBlobSasUrl; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property outputBlobSasUrl in model GetVpnSitesConfigurationRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetVpnSitesConfigurationRequest.class); +} 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..df0de69b22305 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupConnectivity.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/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..cec417a7a0e47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.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.Immutable; +import com.azure.resourcemanager.network.generated.fluent.models.HopLinkProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Hop link. */ +@Immutable +public final class HopLink { + /* + * The ID of the next hop. + */ + @JsonProperty(value = "nextHopId", access = JsonProperty.Access.WRITE_ONLY) + private String nextHopId; + + /* + * Link type. + */ + @JsonProperty(value = "linkType", access = JsonProperty.Access.WRITE_ONLY) + private String linkType; + + /* + * Hop link properties. + */ + @JsonProperty(value = "properties") + private HopLinkProperties innerProperties; + + /* + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /* + * Provides additional context on links. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map context; + + /* + * Resource ID. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..2e855a1013972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HTTP configuration of the connectivity check. */ +@Fluent +public final class HttpConfiguration { + /* + * HTTP method. + */ + @JsonProperty(value = "method") + private HttpMethod method; + + /* + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** 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()); + } + } +} 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..316924be16644 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..bc1b3e3a033be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The HTTP header. */ +@Fluent +public final class HttpHeader { + /* + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value in HTTP header. + */ + @JsonProperty(value = "value") + 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() { + } +} 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..a00ea36e08355 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..3598557f5d96c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Hub.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hub Item. */ +@Fluent +public final class Hub { + /* + * Resource Id. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Resource Type. + */ + @JsonProperty(value = "resourceType") + 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() { + } +} 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..88341b0668d8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..b953590b20888 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP addresses associated with azure firewall. */ +@Fluent +public final class HubIpAddresses { + /* + * Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "publicIPs") + private HubPublicIpAddresses publicIPs; + + /* + * Private IP Address associated with azure firewall. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /** 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(); + } + } +} 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..7b84006fad5db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.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.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..d8f50591051ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfigurationPropertiesFormat.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..3c96b59697797 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP addresses associated with azure firewall. */ +@Fluent +public final class HubPublicIpAddresses { + /* + * The list of Public IP addresses associated with azure firewall or IP addresses to be retained. + */ + @JsonProperty(value = "addresses") + private List addresses; + + /* + * The number of Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "count") + private Integer count; + + /** 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()); + } + } +} 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..eef5c2facf335 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable route. */ +@Fluent +public final class HubRoute { + /* + * The name of the Route that is unique within a RouteTable. This name can be used to access this route. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of destinations (eg: CIDR, ResourceId, Service). + */ + @JsonProperty(value = "destinationType", required = true) + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /* + * The type of next hop (eg: ResourceId). + */ + @JsonProperty(value = "nextHopType", required = true) + private String nextHopType; + + /* + * NextHop resource ID. + */ + @JsonProperty(value = "nextHop", required = true) + private String nextHop; + + /** 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 + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model HubRoute")); + } + if (destinationType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinationType in model HubRoute")); + } + if (destinations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinations in model HubRoute")); + } + if (nextHopType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHopType in model HubRoute")); + } + if (nextHop() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHop in model HubRoute")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HubRoute.class); +} 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..9201174f75643 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.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.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..8381303b3b58d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.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 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..ba9bfabf969fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoutingPreference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..082b8fecaff92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; + +/** An immutable client-side representation of HubVirtualNetworkConnection. */ +public interface HubVirtualNetworkConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the remoteVirtualNetwork property: Reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * Gets the allowHubToRemoteVnetTransit property: Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * Gets the allowRemoteVnetToUseHubVnetGateways property: Deprecated: Allow RemoteVnet to use Virtual Hub's + * gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the provisioningState property: The provisioning state of the hub virtual network connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner object. + * + * @return the inner object. + */ + HubVirtualNetworkConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java new file mode 100644 index 0000000000000..55278c8f59f18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.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.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..97cddc0a63392 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IdpsQueryObject.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Will describe the query to run against the IDPS signatures DB. */ +@Fluent +public final class IdpsQueryObject { + /* + * Contain all filters names and values + */ + @JsonProperty(value = "filters") + private List filters; + + /* + * Search term in all columns + */ + @JsonProperty(value = "search") + private String search; + + /* + * Column to sort response by + */ + @JsonProperty(value = "orderBy") + private OrderBy orderBy; + + /* + * The number of the results to return in each page + */ + @JsonProperty(value = "resultsPerPage") + private Integer resultsPerPage; + + /* + * The number of records matching the filter to skip + */ + @JsonProperty(value = "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(); + } + } +} 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..c485474b8cd7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..e59d50ab97027 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f53b69407d1ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.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.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatPoolPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT pool of the load balancer. */ +@Fluent +public final class InboundNatPool extends SubResource { + /* + * Properties of load balancer inbound nat pool. + */ + @JsonProperty(value = "properties") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..af3ce3449caf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.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.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..902d37e20dc60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListInboundNatRule API service call. */ +@Fluent +public final class InboundNatRuleListResult { + /* + * A list of inbound NAT rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..c98f379aa65db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePortMapping.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Individual port mappings for inbound NAT rule created for backend pool. */ +@Immutable +public final class InboundNatRulePortMapping { + /* + * Name of inbound NAT rule. + */ + @JsonProperty(value = "inboundNatRuleName", access = JsonProperty.Access.WRITE_ONLY) + private String inboundNatRuleName; + + /* + * The reference to the transport protocol used by the inbound NAT rule. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private TransportProtocol protocol; + + /* + * Frontend port. + */ + @JsonProperty(value = "frontendPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer frontendPort; + + /* + * Backend port. + */ + @JsonProperty(value = "backendPort", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..f35388ad968bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePropertiesFormat.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.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..3a0c56b7036c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of InboundNatRules. */ +public interface InboundNatRules { + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer 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..b08df9409eacc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of InboundSecurityRule. */ +public interface InboundSecurityRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of security rule collection. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: NVA inbound security rule type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the rules property: List of allowed rules. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the 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.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + InboundSecurityRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + InboundSecurityRule create(Context context); + } + /** The stage of the InboundSecurityRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the InboundSecurityRule definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the InboundSecurityRule resource. + * + * @return the stage of resource update. + */ + InboundSecurityRule.Update update(); + + /** The template for InboundSecurityRule update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + InboundSecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + InboundSecurityRule apply(Context context); + } + /** The InboundSecurityRule update stages. */ + interface UpdateStages { + /** The stage of the InboundSecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the InboundSecurityRule update allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java new file mode 100644 index 0000000000000..e1477f1385f72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +/** Resource collection API of InboundSecurityRuleOperations. */ +public interface InboundSecurityRuleOperations { + /** + * Begins definition for a new InboundSecurityRule resource. + * + * @param name resource name. + * @return the first stage of the new InboundSecurityRule definition. + */ + InboundSecurityRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java new file mode 100644 index 0000000000000..2a94e041fedda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Inbound Security Rules resource. */ +@Fluent +public final class InboundSecurityRules { + /* + * Protocol. This should be either TCP or UDP. + */ + @JsonProperty(value = "protocol") + private InboundSecurityRulesProtocol protocol; + + /* + * The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * NVA port ranges to be opened up. One needs to provide specific ports. + */ + @JsonProperty(value = "destinationPortRange") + private Integer destinationPortRange; + + /** Creates an instance of InboundSecurityRules class. */ + public InboundSecurityRules() { + } + + /** + * Get the protocol property: Protocol. This should be either TCP or UDP. + * + * @return the protocol value. + */ + public InboundSecurityRulesProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol. This should be either TCP or UDP. + * + * @param protocol the protocol value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withProtocol(InboundSecurityRulesProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @return the destinationPortRange value. + */ + public Integer destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withDestinationPortRange(Integer destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java new file mode 100644 index 0000000000000..7185a8829159d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/IpAddressAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java new file mode 100644 index 0000000000000..606a45cde6697 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import java.util.List; + +/** An immutable client-side representation of IpAddressAvailabilityResult. */ +public interface IpAddressAvailabilityResult { + /** + * Gets the available property: Private IP address availability. + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @return the availableIpAddresses value. + */ + List availableIpAddresses(); + + /** + * Gets the isPlatformReserved property: Private IP address platform reserved. + * + * @return the isPlatformReserved value. + */ + Boolean isPlatformReserved(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner object. + * + * @return the inner object. + */ + IpAddressAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java new file mode 100644 index 0000000000000..ac29dfb046fac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.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.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..88b9e89c98e00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpAllocations API service call. */ +@Fluent +public final class IpAllocationListResult { + /* + * A list of IpAllocation resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..4453740c805bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..ae321c66ca6e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..704e74e5fb3fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpAllocations. */ +public interface IpAllocations { + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ipAllocationName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @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..46481096c0587 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; + +/** An immutable client-side representation of IpConfiguration. */ +public interface IpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner object. + * + * @return the inner object. + */ + IpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java new file mode 100644 index 0000000000000..224f26d1d4384 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of IPConfigurationBgpPeeringAddress. */ +@Fluent +public final class IpConfigurationBgpPeeringAddress { + /* + * The ID of IP configuration which belongs to gateway. + */ + @JsonProperty(value = "ipconfigurationId") + private String ipconfigurationId; + + /* + * The list of default BGP peering addresses which belong to IP configuration. + */ + @JsonProperty(value = "defaultBgpIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List defaultBgpIpAddresses; + + /* + * The list of custom BGP peering addresses which belong to IP configuration. + */ + @JsonProperty(value = "customBgpIpAddresses") + private List customBgpIpAddresses; + + /* + * The list of tunnel public IP addresses which belong to IP configuration. + */ + @JsonProperty(value = "tunnelIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelIpAddresses; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java new file mode 100644 index 0000000000000..89b3bf2909057 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; + +/** An immutable client-side representation of IpConfigurationProfile. */ +public interface IpConfigurationProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Sub Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the subnet property: The reference to the subnet resource to create a container network interface ip + * configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration profile resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner object. + * + * @return the inner object. + */ + IpConfigurationProfileInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..4b78473e31944 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfilePropertiesFormat.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.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..7274e4989bbf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationPropertiesFormat.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..157428a40e2cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..0a902fd14ca1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.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.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..cc14b48b02575 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpGroups API service call. */ +@Fluent +public final class IpGroupListResult { + /* + * The list of IpGroups information resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..2a758dabf8fdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpGroups. */ +public interface IpGroups { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @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..e81d0e33c567d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpPrefixesList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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/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..b3b3ca2c8b551 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IpTag associated with the object. */ +@Fluent +public final class IpTag { + /* + * The IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * The value of the IP tag associated with the public IP. Example: SQL. + */ + @JsonProperty(value = "tag") + private String tag; + + /** 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() { + } +} 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..e9588fa077002 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..3f3469e3c19e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..40148573594cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..c365719682226 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IPSec Policy configuration for a virtual network gateway connection. */ +@Fluent +public final class IpsecPolicy { + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN + * tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN + * tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecEncryption in model IpsecPolicy")); + } + if (ipsecIntegrity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecIntegrity in model IpsecPolicy")); + } + if (ikeEncryption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeEncryption in model IpsecPolicy")); + } + if (ikeIntegrity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeIntegrity in model IpsecPolicy")); + } + if (dhGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property dhGroup in model IpsecPolicy")); + } + if (pfsGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property pfsGroup in model IpsecPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpsecPolicy.class); +} 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..20051a91d3d16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IPv6 Circuit Connection properties for global reach. */ +@Fluent +public final class Ipv6CircuitConnectionConfig { + /* + * /125 IP address space to carve out customer addresses for global reach. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** 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() { + } +} 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..127b9d34eb0ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains IPv6 peering config. */ +@Fluent +public final class Ipv6ExpressRouteCircuitPeeringConfig { + /* + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The reference to the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private SubResource routeFilter; + + /* + * The state of peering. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** 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(); + } + } +} 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..c8cbf4444af21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsGlobal.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..4e20275fe8333 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsWorkloadProtected.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..18dca99eee1eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..527c5c025cb17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RouteTables and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubRouteTablesResult { + /* + * List of RouteTables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..6f15994b15c6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubVirtualNetworkConnectionsResult { + /* + * List of HubVirtualNetworkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..845dfa9c2278d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next + * set of results. + */ +@Fluent +public final class ListP2SVpnGatewaysResult { + /* + * List of P2SVpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..275345656046b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRouteMapsResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RouteMaps and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListRouteMapsResult { + /* + * List of RouteMaps. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..83b53d259c7d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRoutingIntentResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of RoutingIntent resource. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..445cf2fa07671 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubBgpConnections list. */ +@Fluent +public final class ListVirtualHubBgpConnectionResults { + /* + * The list of VirtualHubBgpConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..d38381f59ef6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubIpConfigurations list. */ +@Fluent +public final class ListVirtualHubIpConfigurationResults { + /* + * The list of VirtualHubIpConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..0f2e267eeb235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListVirtualHubRouteTableV2SResult { + /* + * List of VirtualHubRouteTableV2s. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..703303a80b8d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualHubsResult { + /* + * List of VirtualHubs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..ee7e233bca722 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual network gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVirtualNetworkGatewayNatRulesResult { + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..3126d0ae03f13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualWansResult { + /* + * List of VirtualWANs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..93929926161a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnConnectionsResult { + /* + * List of Vpn Connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..6abbeb117c35e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnGatewayNatRulesResult { + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..6c8d77bc3d871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnGatewaysResult { + /* + * List of VpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..38c95b7311d2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationPolicyGroupsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of VpnServerConfigurationPolicyGroups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..29559b8e79e10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnServerConfigurationsResult { + /* + * List of VpnServerConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..dc28fff7c4f15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnSiteLinkConnectionsResult { + /* + * List of VpnSiteLinkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..09f14582464e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnSiteLinksResult { + /* + * List of VpnSitesLinks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..2d0f10c066721 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of + * results. + */ +@Fluent +public final class ListVpnSitesResult { + /* + * List of VpnSites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..045f7bc3a2ae5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.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.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..b5f73d570e812 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.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.resourcemanager.network.generated.fluent.models.LoadBalancerBackendAddressPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Load balancer backend addresses. */ +@Fluent +public final class LoadBalancerBackendAddress { + /* + * Properties of load balancer backend address pool. + */ + @JsonProperty(value = "properties") + private LoadBalancerBackendAddressPropertiesFormat innerProperties; + + /* + * Name of the backend address. + */ + @JsonProperty(value = "name") + 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(); + } + } +} 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..8ad75cd3bb6bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressAdminState.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 com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** Static value Drain for LoadBalancerBackendAddressAdminState. */ + public static final LoadBalancerBackendAddressAdminState DRAIN = fromString("Drain"); + + /** + * 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. + */ + @JsonCreator + 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..5ff468f47b6ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBackendAddressPool API service call. */ +@Fluent +public final class LoadBalancerBackendAddressPoolListResult { + /* + * A list of backend address pools in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..05d5efcb480bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerBackendAddressPools. */ +public interface LoadBalancerBackendAddressPools { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools 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..48b765a1b7866 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFrontendIPConfiguration API service call. */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationListResult { + /* + * A list of frontend IP configurations in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..e0fb9d31acccb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerFrontendIpConfigurations. */ +public interface LoadBalancerFrontendIpConfigurations { + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations 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..e23e140c19ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancers API service call. */ +@Fluent +public final class LoadBalancerListResult { + /* + * A list of load balancers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..463739b023e0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancingRule API service call. */ +@Fluent +public final class LoadBalancerLoadBalancingRuleListResult { + /* + * A list of load balancing rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..4f81a15d2dc74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerLoadBalancingRules. */ +public interface LoadBalancerLoadBalancingRules { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer 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..5fda30f3f9d34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerNetworkInterfaces. */ +public interface LoadBalancerNetworkInterfaces { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces 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..f13932c72794f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListOutboundRule API service call. */ +@Fluent +public final class LoadBalancerOutboundRuleListResult { + /* + * A list of outbound rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..0ea309a167856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..51229667184df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerOutboundRules. */ +public interface LoadBalancerOutboundRules { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer 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..8956341572984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListProbe API service call. */ +@Fluent +public final class LoadBalancerProbeListResult { + /* + * A list of probes in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..569a88a978d68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerProbes. */ +public interface LoadBalancerProbes { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes 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..afa09ec2393f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a load balancer. */ +@Fluent +public final class LoadBalancerSku { + /* + * Name of a load balancer SKU. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /* + * Tier of a load balancer SKU. + */ + @JsonProperty(value = "tier") + 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() { + } +} 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..0000433516cf8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a3baf8dadfbf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..2b45f68e9c0ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request for a VIP swap. */ +@Fluent +public final class LoadBalancerVipSwapRequest { + /* + * A list of frontend IP configuration resources that should swap VIPs. + */ + @JsonProperty(value = "frontendIPConfigurations") + 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()); + } + } +} 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..214ff9efd0b66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.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.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerVipSwapRequestFrontendIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VIP swap request's frontend IP configuration object. */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfiguration { + /* + * The ID of frontend IP configuration resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The properties of VIP swap request's frontend IP configuration object. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..552a50ebcb299 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.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 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); + + /** + * 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..13db0bb4734c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import java.util.List; + +/** An immutable client-side representation of LoadBalancingRule. */ +public interface LoadBalancingRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within the set of load balancing rules used by + * the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + SubResource frontendIpConfiguration(); + + /** + * Gets the backendAddressPool property: A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the backendAddressPools property: An array of references to pool of DIPs. + * + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * Gets the probe property: The reference to the load balancer probe used by the load balancing rule. + * + * @return the probe value. + */ + SubResource probe(); + + /** + * Gets the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * Gets the loadDistribution property: The load distribution policy for this rule. + * + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * Gets the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value. + */ + 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..7696bbd052f2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..43477afa1e2a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.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..db3328ed611ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLocalNetworkGateways API service call. */ +@Fluent +public final class LocalNetworkGatewayListResult { + /* + * A list of local network gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..33b171bef2907 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LocalNetworkGateways. */ +public interface LocalNetworkGateways { + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..3b665f159a04e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of logging specification. */ +@Fluent +public final class LogSpecification { + /* + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** 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() { + } +} 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..8ac729676be70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..264a2f5276ccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + /* + * The managed rule group to override. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * List of rules that will be disabled. If none specified, all rules in the group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** 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 + .logExceptionAsError( + 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); +} 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..bb2595de61d87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * The state of the managed rule. Defaults to Disabled if not specified. + */ + @JsonProperty(value = "state") + private ManagedRuleEnabledState state; + + /* + * Describes the override action to be applied when rule matches. + */ + @JsonProperty(value = "action") + private ActionType action; + + /** 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleOverride.class); +} 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..713f906db0a28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the rule group overrides to apply to the rule set. + */ + @JsonProperty(value = "ruleGroupOverrides") + private List ruleGroupOverrides; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSet.class); +} 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..742f790e91edd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ManagedRulesDefinition { + /* + * The Exclusions that are applied on the policy. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /* + * The managed rule sets that are associated with the policy. + */ + @JsonProperty(value = "managedRuleSets", required = true) + private List managedRuleSets; + + /** Creates an instance of ManagedRulesDefinition class. */ + public ManagedRulesDefinition() { + } + + /** + * Get the exclusions property: The Exclusions that are applied on the policy. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: The Exclusions that are applied on the policy. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Get the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (managedRuleSets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedRuleSets in model ManagedRulesDefinition")); + } else { + managedRuleSets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRulesDefinition.class); +} 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..aa1123b870dd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public class ManagedServiceIdentity { + /* + * The principal id of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will remove any identities from the + * virtual machine. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with resource. The user identity dictionary key references will be ARM + * resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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(); + } + }); + } + } +} 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..2d6ef873eb6db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedServiceIdentityUserAssignedIdentities model. */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentities { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** 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() { + } +} 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..82e95168ec838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagementGroupNetworkManagerConnections.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.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..ed5bbcd4fcc2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define match conditions. */ +@Fluent +public final class MatchCondition { + /* + * List of match variables. + */ + @JsonProperty(value = "matchVariables", required = true) + private List matchVariables; + + /* + * The operator to be matched. + */ + @JsonProperty(value = "operator", required = true) + private WebApplicationFirewallOperator operator; + + /* + * Whether this is negate condition or not. + */ + @JsonProperty(value = "negationConditon") + private Boolean negationConditon; + + /* + * Match value. + */ + @JsonProperty(value = "matchValues", required = true) + private List matchValues; + + /* + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchVariables in model MatchCondition")); + } else { + matchVariables().forEach(e -> e.validate()); + } + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValues() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchValues in model MatchCondition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchCondition.class); +} 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..4c76b20fb2d81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Define match variables. */ +@Fluent +public final class MatchVariable { + /* + * Match Variable. + */ + @JsonProperty(value = "variableName", required = true) + private WebApplicationFirewallMatchVariable variableName; + + /* + * The selector of match variable. + */ + @JsonProperty(value = "selector") + 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property variableName in model MatchVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchVariable.class); +} 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..6f346a6c48c04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Matched rule. */ +@Fluent +public final class MatchedRule { + /* + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /* + * The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** 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() { + } +} 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..1426a577a2122 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of metrics specification. */ +@Fluent +public final class MetricSpecification { + /* + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /* + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /* + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /* + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /* + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /* + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** 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()); + } + } +} 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..95fa21e2bab41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..0660b5e421603 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNatGateways API service call. */ +@Fluent +public final class NatGatewayListResult { + /* + * A list of Nat Gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..ec1dd15a0dcea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of nat gateway. */ +@Fluent +public final class NatGatewaySku { + /* + * Name of Nat Gateway SKU. + */ + @JsonProperty(value = "name") + 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() { + } +} 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..a52a120999040 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..a726f893cb5d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NatGateways. */ +public interface NatGateways { + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String natGatewayName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @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..3f1880f6881af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type nat. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NatRule") +@Fluent +public final class NatRule extends FirewallPolicyRule { + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /** Creates an instance of NatRule class. */ + public NatRule() { + } + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NatRule object itself. + */ + public NatRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the translatedAddress property: The translated address for this NAT rule. + * + * @return the translatedAddress value. + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translatedAddress property: The translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translatedPort property: The translated port for this NAT rule. + * + * @return the translatedPort value. + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translatedPort property: The translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @return the translatedFqdn value. + */ + public String translatedFqdn() { + return this.translatedFqdn; + } + + /** + * Set the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @param translatedFqdn the translatedFqdn value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedFqdn(String translatedFqdn) { + this.translatedFqdn = translatedFqdn; + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..e264e312f0e3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRulePortMapping.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.fasterxml.jackson.annotation.JsonProperty; + +/** Individual port mappings for inbound NAT rule created for backend pool. */ +@Fluent +public final class NatRulePortMapping { + /* + * Name of inbound NAT rule. + */ + @JsonProperty(value = "inboundNatRuleName") + private String inboundNatRuleName; + + /* + * Frontend port. + */ + @JsonProperty(value = "frontendPort") + private Integer frontendPort; + + /* + * Backend port. + */ + @JsonProperty(value = "backendPort") + 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() { + } +} 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..988e7e0a473da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.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 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..88c43b5c30cf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters to get network configuration diagnostic. */ +@Fluent +public final class NetworkConfigurationDiagnosticParameters { + /* + * The ID of the target resource to perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Verbosity level. + */ + @JsonProperty(value = "verbosityLevel") + private VerbosityLevel verbosityLevel; + + /* + * List of network configuration diagnostic profiles. + */ + @JsonProperty(value = "profiles", required = true) + private List profiles; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model" + + " NetworkConfigurationDiagnosticParameters")); + } + if (profiles() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property profiles in model NetworkConfigurationDiagnosticParameters")); + } else { + profiles().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkConfigurationDiagnosticParameters.class); +} 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..c12a29ea5b59a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to compare with network configuration. */ +@Fluent +public final class NetworkConfigurationDiagnosticProfile { + /* + * The direction of the traffic. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /* + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /* + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model NetworkConfigurationDiagnosticProfile")); + } + if (protocol() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model NetworkConfigurationDiagnosticProfile")); + } + if (source() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property source in model NetworkConfigurationDiagnosticProfile")); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model NetworkConfigurationDiagnosticProfile")); + } + if (destinationPort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model NetworkConfigurationDiagnosticProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkConfigurationDiagnosticProfile.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..1799950d60ef4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** An immutable client-side representation of NetworkConfigurationDiagnosticResponse. */ +public interface NetworkConfigurationDiagnosticResponse { + /** + * Gets the results property: List of network configuration diagnostic results. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner object. + * + * @return the inner object. + */ + NetworkConfigurationDiagnosticResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..a513b7e0e9c72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network configuration diagnostic result corresponded to provided traffic query. */ +@Fluent +public final class NetworkConfigurationDiagnosticResult { + /* + * Network configuration diagnostic profile. + */ + @JsonProperty(value = "profile") + private NetworkConfigurationDiagnosticProfile profile; + + /* + * Network security group result. + */ + @JsonProperty(value = "networkSecurityGroupResult") + 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(); + } + } +} 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..e79c725240197 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroup.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.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 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.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.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 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.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 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..8799483dfbdd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of NetworkGroup + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..5417098f7a083 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroups.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 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..e05097cd351cd --- /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; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkGroupsCreateOrUpdateHeaders model. */ +@Fluent +public final class NetworkGroupsCreateOrUpdateHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + 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..4956b9bfa8ec5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateResponse.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.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..99d46978ac8da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..c6da3541ba716 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyBasedService.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..8cc161506b161 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. */ +@Fluent +public final class NetworkIntentPolicyConfiguration { + /* + * The name of the Network Intent Policy for storing in target subscription. + */ + @JsonProperty(value = "networkIntentPolicyName") + private String networkIntentPolicyName; + + /* + * Source network intent policy. + */ + @JsonProperty(value = "sourceNetworkIntentPolicy") + private NetworkIntentPolicy sourceNetworkIntentPolicy; + + /** 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(); + } + } +} 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..021d24e2d5f48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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..e0abb90579e3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network interface and its custom security rules. */ +@Fluent +public final class NetworkInterfaceAssociation { + /* + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** 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()); + } + } +} 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..118f60e6b5cc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliaryMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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/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..6c1bf4dd0d4c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS settings of a network interface. */ +@Fluent +public final class NetworkInterfaceDnsSettings { + /* + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. + * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /* + * If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS + * servers from all NICs that are part of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers", access = JsonProperty.Access.WRITE_ONLY) + private List appliedDnsServers; + + /* + * Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /* + * Fully qualified DNS name supporting internal communications between VMs in the same virtual network. + */ + @JsonProperty(value = "internalFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String internalFqdn; + + /* + * Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS + * name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String internalDomainNameSuffix; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..1e78c234dfa18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of NetworkInterfaceIpConfiguration. */ +public interface NetworkInterfaceIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + SubResource gatewayLoadBalancer(); + + /** + * Gets the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + + /** + * Gets the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * Gets the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * Gets the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * Gets the privateIpAddress property: Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether this is a primary customer address on the network interface. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface IP configuration. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java new file mode 100644 index 0000000000000..95e2a3be4302b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceIpConfigurationListResult { + /* + * A list of ip configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..da697feb84087 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkConnection properties for the network interface. */ +@Immutable +public final class NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties { + /* + * The group ID for current private link connection. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The required member name for current private link connection. + */ + @JsonProperty(value = "requiredMemberName", access = JsonProperty.Access.WRITE_ONLY) + private String requiredMemberName; + + /* + * List of FQDNs for current private link connection. + */ + @JsonProperty(value = "fqdns", access = JsonProperty.Access.WRITE_ONLY) + private List fqdns; + + /** 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() { + } +} 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..8c1b7b17f2317 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPropertiesFormat.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.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. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether this is a primary customer address on the network interface. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface IP configuration. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.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..e0aa50196f94b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceIpConfigurations. */ +public interface NetworkInterfaceIpConfigurations { + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface 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..18279c9d073f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListNetworkInterface API service call. */ +@Fluent +public final class NetworkInterfaceListResult { + /* + * A list of network interfaces in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..813791b84c1d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceLoadBalancerListResult { + /* + * A list of load balancers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..06f254c8bde57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceLoadBalancers. */ +public interface NetworkInterfaceLoadBalancers { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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..95d8109020d97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..48dbd7df71ae6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..46eb8a7347558 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfacePropertiesFormat.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.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 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..4a830beef7def --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..6dd6ef534f57a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list tap configurations API service call. */ +@Fluent +public final class NetworkInterfaceTapConfigurationListResult { + /* + * A list of tap configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..5724655778e76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationPropertiesFormat.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.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..068b25071e1bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceTapConfigurations. */ +public interface NetworkInterfaceTapConfigurations { + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..8d7b3af109ba5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..8479f29b6b4dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManager.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.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 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..e1d8567d9455c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommit.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..8e80867681596 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommits.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.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..f639504049562 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnection.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..316fd1e7e342a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of network manager connections. */ +@Fluent +public final class NetworkManagerConnectionListResult { + /* + * List of network manager connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next page of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..97afea0f5861a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Network Manager Deployment Status. */ +@Fluent +public final class NetworkManagerDeploymentStatus { + /* + * Commit Time. + */ + @JsonProperty(value = "commitTime") + private OffsetDateTime commitTime; + + /* + * Region Name. + */ + @JsonProperty(value = "region") + private String region; + + /* + * Deployment Status. + */ + @JsonProperty(value = "deploymentStatus") + private DeploymentStatus deploymentStatus; + + /* + * List of configuration ids. + */ + @JsonProperty(value = "configurationIds") + private List configurationIds; + + /* + * Configuration Deployment Type. + */ + @JsonProperty(value = "deploymentType") + private ConfigurationType deploymentType; + + /* + * Error Message. + */ + @JsonProperty(value = "errorMessage") + 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() { + } +} 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..cf24b821c3f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusListResult.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.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..2afb6f0c1e13c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusOperations.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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..3371c3afa2136 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusParameter.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Manager Deployment Status Parameter. */ +@Fluent +public final class NetworkManagerDeploymentStatusParameter { + /* + * List of locations. + */ + @JsonProperty(value = "regions") + private List regions; + + /* + * List of deployment types. + */ + @JsonProperty(value = "deploymentTypes") + private List deploymentTypes; + + /* + * Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. + */ + @JsonProperty(value = "skipToken") + 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() { + } +} 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..7b29cd739bd0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveConnectivityConfigurationListResult.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.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..db4b8f302db2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveSecurityAdminRulesListResult.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.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..04028e46e1e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of NetworkManager + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next page of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..855ab306fe0b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerPropertiesNetworkManagerScopes.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Scope of Network Manager. */ +@Fluent +public final class NetworkManagerPropertiesNetworkManagerScopes { + /* + * List of management groups. + */ + @JsonProperty(value = "managementGroups") + private List managementGroups; + + /* + * List of subscriptions. + */ + @JsonProperty(value = "subscriptions") + private List subscriptions; + + /* + * List of cross tenant scopes. + */ + @JsonProperty(value = "crossTenantScopes", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..f366c9a9259bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerSecurityGroupItem.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network manager security group item. */ +@Fluent +public final class NetworkManagerSecurityGroupItem { + /* + * Network manager group Id. + */ + @JsonProperty(value = "networkGroupId", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkGroupId in model NetworkManagerSecurityGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerSecurityGroupItem.class); +} 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..2c7967c7addb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagers.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..78bfa338f65c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.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.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..19813c5ac11d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkProfiles API service call. */ +@Fluent +public final class NetworkProfileListResult { + /* + * A list of network profiles that exist in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..caef88ab65913 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkProfiles. */ +public interface NetworkProfiles { + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkProfileName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @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..2c278bb181201 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type network. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NetworkRule") +@Fluent +public final class NetworkRule extends FirewallPolicyRule { + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /** Creates an instance of NetworkRule class. */ + public NetworkRule() { + } + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationIpGroups(List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Get the destinationFqdns property: List of destination FQDNs. + * + * @return the destinationFqdns value. + */ + public List destinationFqdns() { + return this.destinationFqdns; + } + + /** + * Set the destinationFqdns property: List of destination FQDNs. + * + * @param destinationFqdns the destinationFqdns value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationFqdns(List destinationFqdns) { + this.destinationFqdns = destinationFqdns; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..33a757cfd066b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.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.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..21abf704fa150 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkSecurityGroups API service call. */ +@Fluent +public final class NetworkSecurityGroupListResult { + /* + * A list of NetworkSecurityGroup resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..81c7df1619f11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network configuration diagnostic result corresponded provided traffic query. */ +@Fluent +public final class NetworkSecurityGroupResult { + /* + * The network traffic is allowed or denied. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /* + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** 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()); + } + } +} 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..a1b67288498fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkSecurityGroups. */ +public interface NetworkSecurityGroups { + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @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..70875786c0bab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network security rules evaluation result. */ +@Fluent +public final class NetworkSecurityRulesEvaluationResult { + /* + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /* + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /* + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /* + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /* + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** 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() { + } +} 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..fe23e11371f6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.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.NetworkVirtualApplianceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkVirtualAppliance. */ +public interface NetworkVirtualAppliance { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The service principal that has read access to cloud-init and config blob. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + List virtualApplianceSites(); + + /** + * Gets the inboundSecurityRules property: List of references to InboundSecurityRules. + * + * @return the inboundSecurityRules value. + */ + List inboundSecurityRules(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the 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.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 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); +} 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..d1bcd0709bb8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualAppliances API service call. */ +@Fluent +public final class NetworkVirtualApplianceListResult { + /* + * List of Network Virtual Appliances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..19b965bece763 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSites API service call. */ +@Fluent +public final class NetworkVirtualApplianceSiteListResult { + /* + * List of Network Virtual Appliance sites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..ef5ef313efea5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkVirtualApplianceSku. */ +public interface NetworkVirtualApplianceSku { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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..e3a8b30119237 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network Virtual Appliance Sku Instances + * + *

List of available Sku and instances. + */ +@Immutable +public final class NetworkVirtualApplianceSkuInstances { + /* + * Scale Unit. + */ + @JsonProperty(value = "scaleUnit", access = JsonProperty.Access.WRITE_ONLY) + private String scaleUnit; + + /* + * Instance Count. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** 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() { + } +} 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..9bb9d9d47af38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSkus API service call. */ +@Fluent +public final class NetworkVirtualApplianceSkuListResult { + /* + * List of Network Virtual Appliance Skus that are available. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..04e2a9be72659 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.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 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); + + /** + * 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..6ceed628c0993 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.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.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..3154e0b728422 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkWatchers API service call. */ +@Fluent +public final class NetworkWatcherListResult { + /* + * List of network watcher resources. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..03af2b4b25fa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** Resource collection API of NetworkWatchers. */ +public interface NetworkWatchers { + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..c7541fab2cef7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the source and destination endpoint. */ +@Fluent +public final class NextHopParameters { + /* + * The resource identifier of the target resource against which the action is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIpAddress; + + /* + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must + * be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model NextHopParameters")); + } + if (sourceIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceIpAddress in model NextHopParameters")); + } + if (destinationIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationIpAddress in model NextHopParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NextHopParameters.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java new file mode 100644 index 0000000000000..296e30f871af7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; + +/** An immutable client-side representation of NextHopResult. */ +public interface NextHopResult { + /** + * Gets the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * Gets the nextHopIpAddress property: Next hop IP Address. + * + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * Gets the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @return the routeTableId value. + */ + String routeTableId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner object. + * + * @return the inner object. + */ + NextHopResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java new file mode 100644 index 0000000000000..c46fc480019cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..ed8ac9f5a42e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextStep.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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/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..4befbb74d42a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Office365 breakout categories. */ +@Fluent +public final class O365BreakOutCategoryPolicies { + /* + * Flag to control allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** 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() { + } +} 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..0113eb5d3a284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Office365 breakout policy. */ +@Fluent +public final class O365PolicyProperties { + /* + * Office365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + 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(); + } + } +} 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..268f3318a235c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class Office365PolicyProperties { + /* + * Office 365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + 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(); + } + } +} 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..5f98472523ae0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..4aaa7c0a9b439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: Specification of the service. + * + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..aace02bfb602a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** 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() { + } +} 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..531963447240a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult { + /* + * List of Network operations supported by the Network resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..02bf9279a9189 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specification of the service. */ +@Fluent +public final class OperationPropertiesFormatServiceSpecification { + /* + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + 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()); + } + } +} 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..0d96a5c26c85a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Network Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations 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..73d7bff27c0f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderBy.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a column to sort. */ +@Fluent +public final class OrderBy { + /* + * Describes the actual column name to sort by + */ + @JsonProperty(value = "field") + private String field; + + /* + * Describes if results should be in ascending/descending order + */ + @JsonProperty(value = "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() { + } +} 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..1fa55a14f6cbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java new file mode 100644 index 0000000000000..8c73537a0ba34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import java.util.List; + +/** An immutable client-side representation of OutboundRule. */ +public interface OutboundRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within the set of outbound rules used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value. + */ + Integer allocatedOutboundPorts(); + + /** + * Gets the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + List frontendIpConfigurations(); + + /** + * Gets the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the provisioningState property: The provisioning state of the outbound rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the protocol property: The protocol for the outbound rule in load balancer. + * + * @return the protocol value. + */ + LoadBalancerOutboundRuleProtocol protocol(); + + /** + * Gets the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * Gets the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner object. + * + * @return the inner object. + */ + OutboundRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java new file mode 100644 index 0000000000000..b0bcc90e67eec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..69f198309f506 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class OwaspCrsExclusionEntry { + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private OwaspCrsExclusionEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this + * exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + * applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /* + * The managed rule sets that are associated with the exclusion. + */ + @JsonProperty(value = "exclusionManagedRuleSets") + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model OwaspCrsExclusionEntry")); + } + if (selectorMatchOperator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model OwaspCrsExclusionEntry")); + } + if (selector() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property selector in model OwaspCrsExclusionEntry")); + } + if (exclusionManagedRuleSets() != null) { + exclusionManagedRuleSets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OwaspCrsExclusionEntry.class); +} 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..fcd27c3458515 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f1d745be81970 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..d209af964b49a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.P2SConnectionConfigurationProperties; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** P2SConnectionConfiguration Resource. */ +@Fluent +public final class P2SConnectionConfiguration extends SubResource { + /* + * Properties of the P2S connection configuration. + */ + @JsonProperty(value = "properties") + private P2SConnectionConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java new file mode 100644 index 0000000000000..32c350e5f9cf6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; + +/** An immutable client-side representation of P2SVpnConnectionHealth. */ +public interface P2SVpnConnectionHealth { + /** + * Gets the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @return the sasUrl value. + */ + String sasUrl(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner object. + * + * @return the inner object. + */ + P2SVpnConnectionHealthInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java new file mode 100644 index 0000000000000..7eef202a18ab3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of P2S Vpn connection health request. */ +@Fluent +public final class P2SVpnConnectionHealthRequest { + /* + * The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. + */ + @JsonProperty(value = "vpnUserNamesFilter") + private List vpnUserNamesFilter; + + /* + * The sas-url to download the P2S Vpn connection health detail. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** 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() { + } +} 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..59dec1dec87de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of p2s vpn connections to be disconnected. */ +@Fluent +public final class P2SVpnConnectionRequest { + /* + * List of p2s vpn connection Ids. + */ + @JsonProperty(value = "vpnConnectionIds") + 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() { + } +} 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..996b74ebc211c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..477cfc97ff889 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of P2SVpnGateways. */ +public interface P2SVpnGateways { + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..9f0056d4f861e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class P2SVpnProfileParameters { + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + 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() { + } +} 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..b9185c2540999 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.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.resourcemanager.network.generated.fluent.models.PacketCaptureParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the create packet capture operation. */ +@Fluent +public final class PacketCapture { + /* + * Properties of the packet capture. + */ + @JsonProperty(value = "properties", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model PacketCapture")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PacketCapture.class); +} 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..0081b99e2fce1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.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.fasterxml.jackson.annotation.JsonProperty; + +/** Filter that is applied to packet capture request. Multiple filters can be applied. */ +@Fluent +public final class PacketCaptureFilter { + /* + * Protocol to be filtered on. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for + * range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with + * multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIpAddress; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for + * range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with + * multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIpAddress; + + /* + * Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple + * entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. + * Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /* + * Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple + * entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. + * Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** 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() { + } +} 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..0cdf78846ef99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of packet capture sessions. */ +@Fluent +public final class PacketCaptureListResult { + /* + * Information about packet capture sessions. + */ + @JsonProperty(value = "value") + 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()); + } + } +} 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..13f97ed4c93da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureMachineScope.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of AzureVMSS instances to run packet capture on. + */ + @JsonProperty(value = "include") + private List include; + + /* + * List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. + */ + @JsonProperty(value = "exclude") + 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java new file mode 100644 index 0000000000000..9fd00564615d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of PacketCaptureQueryStatusResult. */ +public interface PacketCaptureQueryStatusResult { + /** + * Gets the name property: The name of the packet capture resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the packet capture resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the captureStartTime property: The start time of the packet capture session. + * + * @return the captureStartTime value. + */ + OffsetDateTime captureStartTime(); + + /** + * Gets the packetCaptureStatus property: The status of the packet capture session. + * + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * Gets the stopReason property: The reason the current packet capture session was stopped. + * + * @return the stopReason value. + */ + String stopReason(); + + /** + * Gets the packetCaptureError property: List of errors of packet capture session. + * + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner + * object. + * + * @return the inner object. + */ + PacketCaptureQueryStatusResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java new file mode 100644 index 0000000000000..bc391660e58fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.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.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 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/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..25bc254736556 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage location for a packet capture session. */ +@Fluent +public final class PacketCaptureStorageLocation { + /* + * The ID of the storage account to save the packet capture session. Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /* + * The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to + * save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /* + * A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual + * machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** 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 + * local file path is provided. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The ID of the storage account to save the packet capture session. Required if no + * local file path is provided. + * + * @param storageId the storageId value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @return the storagePath value. + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @param filePath the filePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..c216bc7ecee07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureTargetType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** 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. + */ + @JsonCreator + 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} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..47f9fc579cd3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PacketCaptures. */ +public interface PacketCaptures { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..218959f577641 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Parameter.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for an Action. */ +@Fluent +public final class Parameter { + /* + * List of route prefixes. + */ + @JsonProperty(value = "routePrefix") + private List routePrefix; + + /* + * List of BGP communities. + */ + @JsonProperty(value = "community") + private List community; + + /* + * List of AS paths. + */ + @JsonProperty(value = "asPath") + 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() { + } +} 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..6465a8c8fe15c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PartnerManagedResourceProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the partner managed resource. */ +@Immutable +public final class PartnerManagedResourceProperties { + /* + * The partner managed resource id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The partner managed ILB resource id + */ + @JsonProperty(value = "internalLoadBalancerId", access = JsonProperty.Access.WRITE_ONLY) + private String internalLoadBalancerId; + + /* + * The partner managed SLB resource id + */ + @JsonProperty(value = "standardLoadBalancerId", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..f5b80edd73782 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PatchObject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Object for patch operations. */ +@Fluent +public final class PatchObject { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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() { + } +} 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..381ea3099fcdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcError. */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates 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. + */ + @JsonCreator + 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..739a44119ef9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..b68454ec7752b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..60c7ab60a7e1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; + +/** An immutable client-side representation of PeerExpressRouteCircuitConnection. */ +public interface PeerExpressRouteCircuitConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * Gets the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * Gets the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * Gets the connectionName property: The name of the express route circuit connection resource. + * + * @return the connectionName value. + */ + String connectionName(); + + /** + * Gets the authResourceGuid property: The resource guid of the authorization used for the express route circuit + * connection. + * + * @return the authResourceGuid value. + */ + String authResourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the peer express route circuit connection + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner + * object. + * + * @return the inner object. + */ + PeerExpressRouteCircuitConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java new file mode 100644 index 0000000000000..5cef9f928845e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs + * to a Private Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class PeerExpressRouteCircuitConnectionListResult { + /* + * The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..6132d9a2143bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.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..8f3de6e5b522f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peer routing details. */ +@Immutable +public final class PeerRoute { + /* + * The peer's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java new file mode 100644 index 0000000000000..921e0847e98c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import java.util.List; + +/** An immutable client-side representation of PeerRouteList. */ +public interface PeerRouteList { + /** + * Gets the value property: List of peer routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner object. + * + * @return the inner object. + */ + PeerRouteListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java new file mode 100644 index 0000000000000..715c4b34e14d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..6158290b5f15d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** Defines contents of a web application firewall global configuration. */ +@Fluent +public final class PolicySettings { + /* + * The state of the policy. + */ + @JsonProperty(value = "state") + private WebApplicationFirewallEnabledState state; + + /* + * The mode of the policy. + */ + @JsonProperty(value = "mode") + private WebApplicationFirewallMode mode; + + /* + * Whether to allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /* + * If the action type is block, customer can override the response status code. + */ + @JsonProperty(value = "customBlockResponseStatusCode") + private Integer customBlockResponseStatusCode; + + /* + * If the action type is block, customer can override the response body. The body must be specified in base64 + * encoding. + */ + @JsonProperty(value = "customBlockResponseBody") + private String customBlockResponseBody; + + /** 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 maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value. + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMaxRequestBodySizeInKb(Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value. + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java new file mode 100644 index 0000000000000..17084846db351 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..e87206a9b09cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..7d26e1b4cbc7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of PrepareNetworkPolicies for Subnet. */ +@Fluent +public final class PrepareNetworkPoliciesRequest { + /* + * The name of the service for which subnet is being prepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * A list of NetworkIntentPolicyConfiguration. + */ + @JsonProperty(value = "networkIntentPolicyConfigurations") + private List networkIntentPolicyConfigurations; + + /** 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()); + } + } +} 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..c47511d5f7ae9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.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.resourcemanager.network.generated.fluent.models.PrivateDnsZonePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateDnsZoneConfig resource. */ +@Fluent +public final class PrivateDnsZoneConfig { + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties of the private dns zone configuration. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java new file mode 100644 index 0000000000000..d29875f57f9cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import java.util.List; + +/** An immutable client-side representation of PrivateDnsZoneGroup. */ +public interface PrivateDnsZoneGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the private dns zone group resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateDnsZoneConfigs property: A collection of private dns zone configurations of the private dns zone + * group. + * + * @return the privateDnsZoneConfigs value. + */ + List privateDnsZoneConfigs(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner object. + * + * @return the inner object. + */ + PrivateDnsZoneGroupInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java new file mode 100644 index 0000000000000..18e8df95d00ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateDnsZoneGroups API service call. */ +@Fluent +public final class PrivateDnsZoneGroupListResult { + /* + * A list of private dns zone group resources in a private endpoint. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..d354fdadd82d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; + +/** Resource collection API of PrivateDnsZoneGroups. */ +public interface PrivateDnsZoneGroups { + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..f716074d81744 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.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.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..55185c0112a15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + String linkIdentifier(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..7849d4a1001d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpointConnection API service call. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * A list of PrivateEndpointConnection resources for a specific private link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..96bce50124d3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionProperties.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.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 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..f4d8aa1d6891b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointIpConfiguration.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IP Configuration of the private endpoint. */ +@Fluent +public final class PrivateEndpointIpConfiguration { + /* + * Properties of private endpoint IP configurations. + */ + @JsonProperty(value = "properties") + private PrivateEndpointIpConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..e899e8d552436 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpoints API service call. */ +@Fluent +public final class PrivateEndpointListResult { + /* + * A list of private endpoint resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..37425f5337588 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointProperties.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.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/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..0f75b3f31e252 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpoints. */ +public interface PrivateEndpoints { + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @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..a1b25688a20e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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 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.WithVisibility, + DefinitionStages.WithAutoApproval, + DefinitionStages.WithFqdns, + DefinitionStages.WithEnableProxyProtocol { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateLinkService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateLinkService create(Context context); + } + /** The stage of the PrivateLinkService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PrivateLinkService definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateLinkService definition allowing to specify loadBalancerFrontendIpConfigurations. */ + interface WithLoadBalancerFrontendIpConfigurations { + /** + * Specifies the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer + * IP configurations.. + * + * @param loadBalancerFrontendIpConfigurations An array of references to the load balancer IP + * configurations. + * @return the next definition stage. + */ + WithCreate withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations); + } + /** The stage of the PrivateLinkService definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: An array of private link service IP configurations.. + * + * @param ipConfigurations An array of private link service IP configurations. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the PrivateLinkService definition allowing to specify visibility. */ + interface WithVisibility { + /** + * Specifies the visibility property: The visibility list of the private link service.. + * + * @param visibility The visibility list of the private link service. + * @return the next definition stage. + */ + WithCreate withVisibility(PrivateLinkServicePropertiesVisibility visibility); + } + /** The stage of the PrivateLinkService definition allowing to specify autoApproval. */ + interface WithAutoApproval { + /** + * Specifies the autoApproval property: The auto-approval list of the private link service.. + * + * @param autoApproval The auto-approval list of the private link service. + * @return the next definition stage. + */ + WithCreate withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval); + } + /** The stage of the PrivateLinkService definition allowing to specify fqdns. */ + interface WithFqdns { + /** + * Specifies the fqdns property: The list of Fqdn.. + * + * @param fqdns The list of Fqdn. + * @return the next definition stage. + */ + WithCreate withFqdns(List fqdns); + } + /** The stage of the PrivateLinkService definition allowing to specify enableProxyProtocol. */ + interface WithEnableProxyProtocol { + /** + * Specifies the enableProxyProtocol property: Whether the private link service is enabled for proxy + * protocol or not.. + * + * @param enableProxyProtocol Whether the private link service is enabled for proxy protocol or not. + * @return the next definition stage. + */ + WithCreate withEnableProxyProtocol(Boolean enableProxyProtocol); + } + } + /** + * Begins update for the PrivateLinkService resource. + * + * @return the stage of resource update. + */ + PrivateLinkService.Update update(); + + /** The template for PrivateLinkService update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithExtendedLocation, + UpdateStages.WithLoadBalancerFrontendIpConfigurations, + UpdateStages.WithIpConfigurations, + UpdateStages.WithVisibility, + UpdateStages.WithAutoApproval, + UpdateStages.WithFqdns, + UpdateStages.WithEnableProxyProtocol { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateLinkService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateLinkService apply(Context context); + } + /** The PrivateLinkService update stages. */ + interface UpdateStages { + /** The stage of the PrivateLinkService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PrivateLinkService update allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the load balancer.. + * + * @param extendedLocation The extended location of the load balancer. + * @return the next definition stage. + */ + Update withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PrivateLinkService update allowing to specify loadBalancerFrontendIpConfigurations. */ + interface WithLoadBalancerFrontendIpConfigurations { + /** + * Specifies the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer + * IP configurations.. + * + * @param loadBalancerFrontendIpConfigurations An array of references to the load balancer IP + * configurations. + * @return the next definition stage. + */ + Update withLoadBalancerFrontendIpConfigurations( + List loadBalancerFrontendIpConfigurations); + } + /** The stage of the PrivateLinkService update allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: An array of private link service IP configurations.. + * + * @param ipConfigurations An array of private link service IP configurations. + * @return the next definition stage. + */ + Update withIpConfigurations(List ipConfigurations); + } + /** The stage of the PrivateLinkService update allowing to specify visibility. */ + interface WithVisibility { + /** + * Specifies the visibility property: The visibility list of the private link service.. + * + * @param visibility The visibility list of the private link service. + * @return the next definition stage. + */ + Update withVisibility(PrivateLinkServicePropertiesVisibility visibility); + } + /** The stage of the PrivateLinkService update allowing to specify autoApproval. */ + interface WithAutoApproval { + /** + * Specifies the autoApproval property: The auto-approval list of the private link service.. + * + * @param autoApproval The auto-approval list of the private link service. + * @return the next definition stage. + */ + Update withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval); + } + /** The stage of the PrivateLinkService update allowing to specify fqdns. */ + interface WithFqdns { + /** + * Specifies the fqdns property: The list of Fqdn.. + * + * @param fqdns The list of Fqdn. + * @return the next definition stage. + */ + Update withFqdns(List fqdns); + } + /** The stage of the PrivateLinkService update allowing to specify enableProxyProtocol. */ + interface WithEnableProxyProtocol { + /** + * Specifies the enableProxyProtocol property: Whether the private link service is enabled for proxy + * protocol or not.. + * + * @param enableProxyProtocol Whether the private link service is enabled for proxy protocol or not. + * @return the next definition stage. + */ + Update withEnableProxyProtocol(Boolean enableProxyProtocol); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateLinkService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateLinkService refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.java new file mode 100644 index 0000000000000..592f9e7524ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.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.resourcemanager.network.generated.fluent.models.PrivateLinkServiceConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkServiceConnection resource. */ +@Fluent +public final class PrivateLinkServiceConnection extends SubResource { + /* + * Properties of the private link service connection. + */ + @JsonProperty(value = "properties") + private PrivateLinkServiceConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..ab1723758d9fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.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.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java new file mode 100644 index 0000000000000..c854b99fbd21f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; + +/** An immutable client-side representation of PrivateLinkServiceIpConfiguration. */ +public interface PrivateLinkServiceIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of private link service ip configuration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the provisioningState property: The provisioning state of the private link service IP configuration + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..7d1af52461221 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfigurationProperties.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.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..1fec5cfb84363 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateLinkService API service call. */ +@Fluent +public final class PrivateLinkServiceListResult { + /* + * A list of PrivateLinkService resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..56b4017417f0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import 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() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java new file mode 100644 index 0000000000000..d59f6b1d03dec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import 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() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java new file mode 100644 index 0000000000000..0c660c4e70e12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; + +/** An immutable client-side representation of PrivateLinkServiceVisibility. */ +public interface PrivateLinkServiceVisibility { + /** + * Gets the visible property: Private Link Service Visibility (True/False). + * + * @return the visible value. + */ + Boolean visible(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceVisibilityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java new file mode 100644 index 0000000000000..4983be6da21b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.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.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..460d0201f5fa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.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.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 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/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..1daf219a952c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ + @JsonCreator + 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..c8b7936123bdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..15e6f37e158da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of RouteTables to advertise the routes to. */ +@Fluent +public final class PropagatedRouteTable { + /* + * The list of labels. + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The list of resource ids of all the RouteTables. + */ + @JsonProperty(value = "ids") + private List ids; + + /** 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() { + } +} 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..c85741f7738b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..5b61ac83b2bc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration of the protocol. */ +@Fluent +public final class ProtocolConfiguration { + /* + * HTTP configuration of the connectivity check. + */ + @JsonProperty(value = "HTTPConfiguration") + 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(); + } + } +} 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..7f8b4a1ab5e9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..d693de6bd80ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..0028bd7ea68d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.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.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..c8c50d6b24441 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains FQDN of the DNS record associated with the public IP address. */ +@Fluent +public final class PublicIpAddressDnsSettings { + /* + * The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the + * fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS + * record is created for the public IP in the Microsoft Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /* + * The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of + * the domainNameLabel and the regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the + * reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa + * domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** 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 fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value. + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java new file mode 100644 index 0000000000000..ef1f2b3e8435b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpAddresses API service call. */ +@Fluent +public final class PublicIpAddressListResult { + /* + * A list of public IP addresses that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..377951139a0be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..9f9f6538281b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressPropertiesFormat.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.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..6729dff6697ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a public IP address. */ +@Fluent +public final class PublicIpAddressSku { + /* + * Name of a public IP address SKU. + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Tier of a public IP address SKU. + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** 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() { + } +} 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..2d6e37c90dcfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..8cdf34d75a32f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..82f8186fbaf70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.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.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..93e8f37caa748 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpDdosProtectionStatusResult.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.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..a2714cc2ecef6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..1d29c6c9efdd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpPrefixes API service call. */ +@Fluent +public final class PublicIpPrefixListResult { + /* + * A list of public IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..775276d6f1778 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixPropertiesFormat.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..e409143f1a21c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a public IP prefix. */ +@Fluent +public final class PublicIpPrefixSku { + /* + * Name of a public IP prefix SKU. + */ + @JsonProperty(value = "name") + private PublicIpPrefixSkuName name; + + /* + * Tier of a public IP prefix SKU. + */ + @JsonProperty(value = "tier") + private PublicIpPrefixSkuTier tier; + + /** 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() { + } +} 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..3a970b4518267 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..6e4dcef55aec2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..1ecab73df6c87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PublicIpPrefixes. */ +public interface PublicIpPrefixes { + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String publicIpPrefixName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @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..1504745e21a8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosDefinition.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Quality of Service defines the traffic configuration between endpoints. Mandatory to have one marking. */ +@Fluent +public final class QosDefinition { + /* + * List of markings to be used in the configuration. + */ + @JsonProperty(value = "markings") + private List markings; + + /* + * Source IP ranges. + */ + @JsonProperty(value = "sourceIpRanges") + private List sourceIpRanges; + + /* + * Destination IP ranges. + */ + @JsonProperty(value = "destinationIpRanges") + private List destinationIpRanges; + + /* + * Sources port ranges. + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * Destination port ranges. + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * RNM supported protocol types. + */ + @JsonProperty(value = "protocol") + 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()); + } + } +} 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..89c68e09fcc42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Qos Traffic Profiler IP Range properties. */ +@Fluent +public final class QosIpRange { + /* + * Start IP Address. + */ + @JsonProperty(value = "startIP") + private String startIp; + + /* + * End IP Address. + */ + @JsonProperty(value = "endIP") + 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() { + } +} 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..86f2351472440 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Qos Traffic Profiler Port range properties. */ +@Fluent +public final class QosPortRange { + /* + * Qos Port Range start. + */ + @JsonProperty(value = "start") + private Integer start; + + /* + * Qos Port Range end. + */ + @JsonProperty(value = "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() { + } +} 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..c661cac44f0d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryInboundNatRulePortMappingRequest.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.fasterxml.jackson.annotation.JsonProperty; + +/** The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or IpAddress should be set. */ +@Fluent +public final class QueryInboundNatRulePortMappingRequest { + /* + * NetworkInterfaceIPConfiguration set in load balancer backend address. + */ + @JsonProperty(value = "ipConfiguration") + private SubResource ipConfiguration; + + /* + * IP address set in load balancer backend address. + */ + @JsonProperty(value = "ipAddress") + 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() { + } +} 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..b49890bc5e069 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryRequestOptions.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Query Request Options. */ +@Fluent +public final class QueryRequestOptions { + /* + * 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. + */ + @JsonProperty(value = "skipToken") + 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() { + } +} 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..e9635e419413a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryResults.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..1725c2af567e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the resource to query the troubleshooting result. */ +@Fluent +public final class QueryTroubleshootingParameters { + /* + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model QueryTroubleshootingParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryTroubleshootingParameters.class); +} 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..529d69ccb47ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Radius Server Settings. */ +@Fluent +public final class RadiusServer { + /* + * The address of this radius server. + */ + @JsonProperty(value = "radiusServerAddress", required = true) + private String radiusServerAddress; + + /* + * The initial score assigned to this radius server. + */ + @JsonProperty(value = "radiusServerScore") + private Long radiusServerScore; + + /* + * The secret used for this radius server. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property radiusServerAddress in model RadiusServer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RadiusServer.class); +} 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..e9f6a96851862 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collective group of information about the record set information. */ +@Fluent +public final class RecordSet { + /* + * Resource record type. + */ + @JsonProperty(value = "recordType") + private String recordType; + + /* + * Recordset name. + */ + @JsonProperty(value = "recordSetName") + private String recordSetName; + + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The provisioning state of the recordset. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Recordset time to live. + */ + @JsonProperty(value = "ttl") + private Integer ttl; + + /* + * The private ip address of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** 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() { + } +} 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..635c09eab7c82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a public IP address. */ +@Fluent +public final class ReferencedPublicIpAddress { + /* + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + 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() { + } +} 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..33256c2f7baea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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. + */ + @JsonCreator + 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} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java new file mode 100644 index 0000000000000..d87abfee2d62e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinkFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ResourceNavigationLink resource. */ +@Fluent +public final class ResourceNavigationLink extends SubResource { + /* + * Resource navigation link properties format. + */ + @JsonProperty(value = "properties") + private ResourceNavigationLinkFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..950580b4a9786 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceNavigationLinks. */ +public interface ResourceNavigationLinks { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..8ba08d898b2f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ResourceNavigationLinksListResult. */ +public interface ResourceNavigationLinksListResult { + /** + * Gets the value property: The resource navigation links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner + * object. + * + * @return the inner object. + */ + ResourceNavigationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java new file mode 100644 index 0000000000000..18318b3cc1048 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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..ee61d80281194 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The base resource set for visibility and auto-approval. */ +@Fluent +public class ResourceSet { + /* + * The list of subscriptions. + */ + @JsonProperty(value = "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() { + } +} 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..ed961aa13c18d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the retention policy for flow log. */ +@Fluent +public final class RetentionPolicyParameters { + /* + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** 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() { + } +} 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..4a38aa48f3bb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.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.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, + DefinitionStages.WithHasBgpOverride { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route create(Context context); + } + /** The stage of the Route definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Route definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Route definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Route definition allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route definition allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route definition allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + WithCreate withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Begins update for the Route resource. + * + * @return the stage of resource update. + */ + Route.Update update(); + + /** The template for Route update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithNextHopType, + UpdateStages.WithNextHopIpAddress, + UpdateStages.WithHasBgpOverride { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route apply(Context context); + } + /** The Route update stages. */ + interface UpdateStages { + /** The stage of the Route update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Route update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Route update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Route update allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + Update withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route update allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route update allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + Update withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java new file mode 100644 index 0000000000000..b2561e478b003 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.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.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..c80355866fe51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilters API service call. */ +@Fluent +public final class RouteFilterListResult { + /* + * A list of route filters in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java new file mode 100644 index 0000000000000..00b9e209e89c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.util.List; + +/** An immutable client-side representation of RouteFilterRule. */ +public interface RouteFilterRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the access property: The access type of the rule. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the routeFilterRuleType property: The rule type of the rule. + * + * @return the routeFilterRuleType value. + */ + RouteFilterRuleType routeFilterRuleType(); + + /** + * Gets the communities property: The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + * + * @return the communities value. + */ + List communities(); + + /** + * Gets the provisioningState property: The provisioning state of the route filter rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner object. + * + * @return the inner object. + */ + RouteFilterRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java new file mode 100644 index 0000000000000..06359b0f3aff3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilterRules API service call. */ +@Fluent +public final class RouteFilterRuleListResult { + /* + * A list of RouteFilterRules in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..edc031e1a634c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..f42405a5b5daa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; + +/** Resource collection API of RouteFilterRules. */ +public interface RouteFilterRules { + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..8624c06878c72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RouteFilters. */ +public interface RouteFilters { + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, Context context); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @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..9f536a1cd09a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRoute API service call. */ +@Fluent +public final class RouteListResult { + /* + * A list of routes in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..032cde495c718 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMap.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.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..2c240bc4707cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapActionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a557276471529 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapMatchCondition.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..ccab31096fbb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapRule.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A RouteMap Rule. */ +@Fluent +public final class RouteMapRule { + /* + * The unique name for the rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * List of matching criterion which will be applied to traffic. + */ + @JsonProperty(value = "matchCriteria") + private List matchCriteria; + + /* + * List of actions which will be applied on a match. + */ + @JsonProperty(value = "actions") + private List actions; + + /* + * Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. + */ + @JsonProperty(value = "nextStepIfMatched") + 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()); + } + } +} 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..a27ee5f2e2514 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMaps.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 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..117b160bba683 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..bf7d54d32d475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.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.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..0e7bc35b7cda6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteTable API service call. */ +@Fluent +public final class RouteTableListResult { + /* + * A list of route tables in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..0c9cd6f84bd01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RouteTables. */ +public interface RouteTables { + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, Context context); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @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..8c00770266312 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Routes. */ +public interface Routes { + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, String routeName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..d82aaf912d1e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.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.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Routing Configuration indicating the associated and propagated route tables for this connection. */ +@Fluent +public final class RoutingConfiguration { + /* + * The resource id RouteTable associated with this RoutingConfiguration. + */ + @JsonProperty(value = "associatedRouteTable") + private SubResource associatedRouteTable; + + /* + * The list of RouteTables to advertise the routes to. + */ + @JsonProperty(value = "propagatedRouteTables") + private PropagatedRouteTable propagatedRouteTables; + + /* + * List of routes that control routing from VirtualHub into a virtual network connection. + */ + @JsonProperty(value = "vnetRoutes") + private VnetRoute vnetRoutes; + + /* + * The resource id of the RouteMap associated with this RoutingConfiguration for inbound learned routes. + */ + @JsonProperty(value = "inboundRouteMap") + private SubResource inboundRouteMap; + + /* + * The resource id of theRouteMap associated with this RoutingConfiguration for outbound advertised routes. + */ + @JsonProperty(value = "outboundRouteMap") + 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(); + } + } +} 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..9a52caeaee82c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntent.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..3333f11011c03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.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 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..a67d72cbf4809 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The routing policy object used in a RoutingIntent resource. */ +@Fluent +public final class RoutingPolicy { + /* + * The unique name for the routing policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /* + * The next hop resource id on which this routing policy is applicable to. + */ + @JsonProperty(value = "nextHop", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RoutingPolicy")); + } + if (destinations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinations in model RoutingPolicy")); + } + if (nextHop() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHop in model RoutingPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingPolicy.class); +} 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..900ff89e6a2f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..ac2517c7d8aca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnection.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.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..d98661d6fdd67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of scope connections. */ +@Fluent +public final class ScopeConnectionListResult { + /* + * List of scope connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next page of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..86532ed52530f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionState.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..b1c1e0733d8dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnections.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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/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..e1a962b288d38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfiguration.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.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 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..1e3d780d84e26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of network manager security admin configurations. */ +@Fluent +public final class SecurityAdminConfigurationListResult { + /* + * Gets a page of security admin configurations + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next page of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..04839ead2b759 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurations.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 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..5b0a2dfbce1ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleAccess.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..916a5fce0ad6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleDirection.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..6153a97816f54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleProtocol.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..5a839a7113e98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network interface and all its associated security rules. */ +@Fluent +public final class SecurityGroupNetworkInterface { + /* + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /* + * All security rules associated with the network interface. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** 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(); + } + } +} 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..9c28c7e3f141f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the VM to check security groups for. */ +@Fluent +public final class SecurityGroupViewParameters { + /* + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model SecurityGroupViewParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityGroupViewParameters.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..363f7178b5daa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import java.util.List; + +/** An immutable client-side representation of SecurityGroupViewResult. */ +public interface SecurityGroupViewResult { + /** + * Gets the networkInterfaces property: List of network interfaces on the specified VM. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner object. + * + * @return the inner object. + */ + SecurityGroupViewResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java new file mode 100644 index 0000000000000..d2d1da694dc84 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.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.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..f36a8f6b84692 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..4a6da8ff1b950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSecurityPartnerProviders API service call. */ +@Fluent +public final class SecurityPartnerProviderListResult { + /* + * List of Security Partner Providers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..d1186909f5686 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.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 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..9bbc75ea305e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..f0353af65ad45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java @@ -0,0 +1,684 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of SecurityRule. */ +public interface SecurityRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + String description(); + + /** + * Gets the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * Gets the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' + * can also be used to match all ports. + * + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * Gets the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + * + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * Gets the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this + * is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * Gets the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * Gets the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * Gets the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. + * Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * Gets the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * Gets the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * Gets the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * Gets the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * Gets the access property: The network traffic is allowed or denied. + * + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * Gets the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * Gets the provisioningState property: The provisioning state of the security rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the 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(Integer priority); + } + /** The stage of the SecurityRule definition allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + WithCreate withDirection(SecurityRuleDirection direction); + } + } + /** + * Begins update for the SecurityRule resource. + * + * @return the stage of resource update. + */ + SecurityRule.Update update(); + + /** The template for SecurityRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithDescription, + UpdateStages.WithProtocol, + UpdateStages.WithSourcePortRange, + UpdateStages.WithDestinationPortRange, + UpdateStages.WithSourceAddressPrefix, + UpdateStages.WithSourceAddressPrefixes, + UpdateStages.WithSourceApplicationSecurityGroups, + UpdateStages.WithDestinationAddressPrefix, + UpdateStages.WithDestinationAddressPrefixes, + UpdateStages.WithDestinationApplicationSecurityGroups, + UpdateStages.WithSourcePortRanges, + UpdateStages.WithDestinationPortRanges, + UpdateStages.WithAccess, + UpdateStages.WithPriority, + UpdateStages.WithDirection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityRule apply(Context context); + } + /** The SecurityRule update stages. */ + interface UpdateStages { + /** The stage of the SecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the SecurityRule update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the SecurityRule update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule. Restricted to 140 chars.. + * + * @param description A description for this rule. Restricted to 140 chars. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the SecurityRule update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Network protocol this rule applies to.. + * + * @param protocol Network protocol this rule applies to. + * @return the next definition stage. + */ + Update withProtocol(SecurityRuleProtocol protocol); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRange. */ + interface WithSourcePortRange { + /** + * Specifies the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports.. + * + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can + * also be used to match all ports. + * @return the next definition stage. + */ + Update withSourcePortRange(String sourcePortRange); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRange. */ + interface WithDestinationPortRange { + /** + * Specifies the destinationPortRange property: The destination port or range. Integer or range between 0 + * and 65535. Asterisk '*' can also be used to match all ports.. + * + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + * @return the next definition stage. + */ + Update withDestinationPortRange(String destinationPortRange); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefix. */ + interface WithSourceAddressPrefix { + /** + * Specifies the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + * be used. If this is an ingress rule, specifies where network traffic originates from.. + * + * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @return the next definition stage. + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefixes. */ + interface WithSourceAddressPrefixes { + /** + * Specifies the sourceAddressPrefixes property: The CIDR or source IP ranges.. + * + * @param sourceAddressPrefixes The CIDR or source IP ranges. + * @return the next definition stage. + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify sourceApplicationSecurityGroups. */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies the sourceApplicationSecurityGroups property: The application security group specified as + * source.. + * + * @param sourceApplicationSecurityGroups The application security group specified as source. + * @return the next definition stage. + */ + Update withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefix. */ + interface WithDestinationAddressPrefix { + /** + * Specifies the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP + * range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used.. + * + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @return the next definition stage. + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefixes. */ + interface WithDestinationAddressPrefixes { + /** + * Specifies the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination + * IP ranges.. + * + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify destinationApplicationSecurityGroups. */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies the destinationApplicationSecurityGroups property: The application security group specified as + * destination.. + * + * @param destinationApplicationSecurityGroups The application security group specified as destination. + * @return the next definition stage. + */ + Update withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: The source port ranges.. + * + * @param sourcePortRanges The source port ranges. + * @return the next definition stage. + */ + Update withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: The destination port ranges.. + * + * @param destinationPortRanges The destination port ranges. + * @return the next definition stage. + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the SecurityRule update allowing to specify access. */ + interface WithAccess { + /** + * Specifies the access property: The network traffic is allowed or denied.. + * + * @param access The network traffic is allowed or denied. + * @return the next definition stage. + */ + Update withAccess(SecurityRuleAccess access); + } + /** The stage of the SecurityRule update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher + * the priority of the rule.. + * + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of + * the rule. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the SecurityRule update allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + Update withDirection(SecurityRuleDirection direction); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java new file mode 100644 index 0000000000000..5e40d42521126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..02ba0256b6dd6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** All security rules associated with the network interface. */ +@Fluent +public final class SecurityRuleAssociations { + /* + * Network interface and it's custom security rules. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /* + * Subnet and it's custom security rules. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /* + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /* + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** 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()); + } + } +} 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..5d08a727f88fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..9fa76fc427ce8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security + * group. + */ +@Fluent +public final class SecurityRuleListResult { + /* + * The security rules in a network security group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..227299c5a43eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..9020032fd78f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SecurityRules. */ +public interface SecurityRules { + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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/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..41cf2acd6e88d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.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.resourcemanager.network.generated.fluent.models.ServiceAssociationLinkPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ServiceAssociationLink resource. */ +@Fluent +public final class ServiceAssociationLink extends SubResource { + /* + * Resource navigation link properties format. + */ + @JsonProperty(value = "properties") + private ServiceAssociationLinkPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** 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(); + } + } +} 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..b98eb15a12ff3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceAssociationLinks. */ +public interface ServiceAssociationLinks { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..673ba5c9acc07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceAssociationLinksListResult. */ +public interface ServiceAssociationLinksListResult { + /** + * Gets the value property: The service association links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner + * object. + * + * @return the inner object. + */ + ServiceAssociationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..2e6cbe1f6875c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceEndpointPolicies. */ +public interface ServiceEndpointPolicies { + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @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..90b5df46b6d60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..8a3d97c6d5b00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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..254d36dc3549c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition + * that belongs to a service endpoint policy. + */ +@Fluent +public final class ServiceEndpointPolicyDefinitionListResult { + /* + * The service endpoint policy definition in a service endpoint policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..fdb62d32a3749 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.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 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..18162a0811b96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListServiceEndpointPolicies API service call. */ +@Fluent +public final class ServiceEndpointPolicyListResult { + /* + * A list of ServiceEndpointPolicy resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..47a68f80caeb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The service endpoint properties. */ +@Fluent +public final class ServiceEndpointPropertiesFormat { + /* + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /* + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The provisioning state of the service endpoint resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** 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 locations property: A list of locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A list of locations. + * + * @param locations the locations value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..62124ff0f5c8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..29911d95e6ff8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..7a3c5923fafff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for Get ServiceTagInformation API service call. Retrieves the list of service tag information resources. */ +@Fluent +public final class ServiceTagInformationListResult { + /* + * The list of service tag information resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..a14fac56b2222 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the service tag information. */ +@Immutable +public final class ServiceTagInformationPropertiesFormat { + /* + * The iteration number of service tag. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The region of service tag. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The name of system service. + */ + @JsonProperty(value = "systemService", access = JsonProperty.Access.WRITE_ONLY) + private String systemService; + + /* + * The list of IP address prefixes. + */ + @JsonProperty(value = "addressPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List addressPrefixes; + + /* + * The state of the service tag. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** 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() { + } +} 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..29809f438df40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformations.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.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..807e3c9503c8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceTags. */ +public interface ServiceTags { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if 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..96ad8929674a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceTagsListResult. */ +public interface ServiceTagsListResult { + /** + * Gets the name property: The name of the cloud. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the cloud. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The azure resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + String changeNumber(); + + /** + * Gets the cloud property: The name of the cloud. + * + * @return the cloud value. + */ + String cloud(); + + /** + * Gets the values property: The list of service tag information resources. + * + * @return the values value. + */ + List values(); + + /** + * Gets the nextLink property: The URL to get next page of service tag information resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner object. + * + * @return the inner object. + */ + ServiceTagsListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java new file mode 100644 index 0000000000000..dac11de730036 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of session IDs. */ +@Fluent +public final class SessionIds { + /* + * List of session IDs. + */ + @JsonProperty(value = "sessionIds") + 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() { + } +} 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..01f86b479b38a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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/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..8dd8f1381b13d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesQuery.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the filter values possibles for a given column. */ +@Fluent +public final class SignatureOverridesFilterValuesQuery { + /* + * Describes the name of the column which values will be returned + */ + @JsonProperty(value = "filterName") + 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() { + } +} 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..de28f0501b5e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesResponse.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.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..516584a18ad6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverrides.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..2a07ca065efd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesList.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.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..27637971b9980 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Will contain the properties of the resource (the actual signature overrides). */ +@Fluent +public final class SignaturesOverridesProperties { + /* + * Dictionary of + */ + @JsonProperty(value = "signatures") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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() { + } +} 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..5de0a3c738484 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SingleQueryResult model. */ +@Fluent +public final class SingleQueryResult { + /* + * The ID of the signature + */ + @JsonProperty(value = "signatureId") + private Integer signatureId; + + /* + * The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + */ + @JsonProperty(value = "mode") + private FirewallPolicyIdpsSignatureMode mode; + + /* + * Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High + */ + @JsonProperty(value = "severity") + private FirewallPolicyIdpsSignatureSeverity severity; + + /* + * Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional + */ + @JsonProperty(value = "direction") + private FirewallPolicyIdpsSignatureDirection direction; + + /* + * Describes the groups the signature belongs to + */ + @JsonProperty(value = "group") + private String group; + + /* + * Describes what is the signature enforces + */ + @JsonProperty(value = "description") + private String description; + + /* + * Describes the protocol the signatures is being enforced in + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * Describes the list of source ports related to this signature + */ + @JsonProperty(value = "sourcePorts") + private List sourcePorts; + + /* + * Describes the list of destination ports related to this signature + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * Describes the last updated time of the signature (provided from 3rd party vendor) + */ + @JsonProperty(value = "lastUpdated") + private String lastUpdated; + + /* + * Describes if this override is inherited from base policy or not + */ + @JsonProperty(value = "inheritedFromParentPolicy") + 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 - Low, 2 - Medium, 3 - High. + * + * @return the severity value. + */ + public FirewallPolicyIdpsSignatureSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High. + * + * @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 - Inbound, 1 - OutBound, + * 2 - Bidirectional. + * + * @return the direction value. + */ + public FirewallPolicyIdpsSignatureDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, + * 2 - Bidirectional. + * + * @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() { + } +} 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..25fe7d451e680 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The sku of this Bastion Host. */ +@Fluent +public final class Sku { + /* + * The name of this Bastion Host. + */ + @JsonProperty(value = "name") + private BastionHostSkuName name; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: The name of this Bastion Host. + * + * @return the name value. + */ + public BastionHostSkuName name() { + return this.name; + } + + /** + * Set the name property: The name of this Bastion Host. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(BastionHostSkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..009626fc8f319 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SlotType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** 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. + */ + @JsonCreator + 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} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..9b62bf5aae343 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMember.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.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..f490cb215073a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMemberListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets a page of StaticMember + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..dc965a4d08ad2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMembers.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..fcaded8a94587 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all Static Routes. */ +@Fluent +public final class StaticRoute { + /* + * The name of the StaticRoute that is unique within a VnetRoute. + */ + @JsonProperty(value = "name") + private String name; + + /* + * List of all address prefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * The ip address of the next hop. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** 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() { + } +} 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..7022b301501ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoutesConfig.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration for static routes on this HubVnetConnectionConfiguration for static routes on this HubVnetConnection. + */ +@Fluent +public final class StaticRoutesConfig { + /* + * Boolean indicating whether static routes on this connection are automatically propagate to route tables which + * this connection propagates to. + */ + @JsonProperty(value = "propagateStaticRoutes", access = JsonProperty.Access.WRITE_ONLY) + private Boolean propagateStaticRoutes; + + /* + * Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. + */ + @JsonProperty(value = "vnetLocalRouteOverrideCriteria") + 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() { + } +} 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..0bc70e5307741 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java @@ -0,0 +1,657 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + Subnet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Subnet create(Context context); + } + /** The stage of the Subnet definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Subnet definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Subnet definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet definition allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet definition allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet definition allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + WithCreate withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet definition allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet definition allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + WithCreate withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet definition allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + WithCreate withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet definition allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + WithCreate withDelegations(List delegations); + } + /** The stage of the Subnet definition allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + WithCreate withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Begins update for the Subnet resource. + * + * @return the stage of resource update. + */ + Subnet.Update update(); + + /** The template for Subnet update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithAddressPrefixes, + UpdateStages.WithNetworkSecurityGroup, + UpdateStages.WithRouteTable, + UpdateStages.WithNatGateway, + UpdateStages.WithServiceEndpoints, + UpdateStages.WithServiceEndpointPolicies, + UpdateStages.WithIpAllocations, + UpdateStages.WithDelegations, + UpdateStages.WithPrivateEndpointNetworkPolicies, + UpdateStages.WithPrivateLinkServiceNetworkPolicies, + UpdateStages.WithApplicationGatewayIpConfigurations { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Subnet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Subnet apply(Context context); + } + /** The Subnet update stages. */ + interface UpdateStages { + /** The stage of the Subnet update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Subnet update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Subnet update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet update allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet update allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet update allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + Update withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet update allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + Update withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet update allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + Update withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet update allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet update allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + Update withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet update allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + Update withDelegations(List delegations); + } + /** The stage of the Subnet update allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + Update withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + Update withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + Update withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Subnet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Subnet refresh(Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java new file mode 100644 index 0000000000000..3841702dd33ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet and it's custom security rules. */ +@Fluent +public final class SubnetAssociation { + /* + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + 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()); + } + } +} 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..e2f0aecb10a8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. */ +@Fluent +public final class SubnetListResult { + /* + * The subnets in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..ed2de0bc7be6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetPropertiesFormat.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.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 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..e7e4bd8aabdaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Subnets. */ +public interface Subnets { + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @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..4668dabf23861 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubscriptionNetworkManagerConnections.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** 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..7ff601c7c46e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResource.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..6f959413840b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.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..952f0c7bc3af9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Swap resource properties. */ +@Fluent +public final class SwapResourceProperties { + /* + * Specifies slot info on a cloud service + */ + @JsonProperty(value = "slotType") + 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() { + } +} 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..1bb513a3c95bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for 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. + */ + @JsonCreator + 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..683b042d39929 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java new file mode 100644 index 0000000000000..5cab2dbe7ab52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Topology. */ +public interface Topology { + /** + * Gets the id property: GUID representing the operation id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the createdDateTime property: The datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the lastModified property: The datetime when the topology was last modified. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the resources property: A list of topology resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TopologyInner object. + * + * @return the inner object. + */ + TopologyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java new file mode 100644 index 0000000000000..4ad279c2f90a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resources that have an association with the parent resource. */ +@Fluent +public final class TopologyAssociation { + /* + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The association type of the child resource to the parent resource. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** 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() { + } +} 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..246f02c44504a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the representation of topology. */ +@Fluent +public final class TopologyParameters { + /* + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /* + * The reference to the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /* + * The reference to the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** 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() { + } +} 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..cf2697223b572 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network resource topology information for the given resource group. */ +@Fluent +public final class TopologyResource { + /* + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Holds the associations the resource has with other resources in the resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** 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()); + } + } +} 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..0653ae440d141 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsConfigurationProperties { + /* + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion") + private String workspaceRegion; + + /* + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /* + * The interval in minutes which would decide how frequently TA service should do flow analytics. + */ + @JsonProperty(value = "trafficAnalyticsInterval") + private Integer trafficAnalyticsInterval; + + /** 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() { + } +} 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..9a7a2b9bb1e53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsProperties { + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration") + 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(); + } + } +} 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..82d5646b575ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An traffic selector policy for a virtual network gateway connection. */ +@Fluent +public final class TrafficSelectorPolicy { + /* + * A collection of local address spaces in CIDR format. + */ + @JsonProperty(value = "localAddressRanges", required = true) + private List localAddressRanges; + + /* + * A collection of remote address spaces in CIDR format. + */ + @JsonProperty(value = "remoteAddressRanges", required = true) + private List remoteAddressRanges; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localAddressRanges in model TrafficSelectorPolicy")); + } + if (remoteAddressRanges() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteAddressRanges in model TrafficSelectorPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TrafficSelectorPolicy.class); +} 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..5fd7968490d4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..786278f572c2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information gained from troubleshooting of specified resource. */ +@Fluent +public final class TroubleshootingDetails { + /* + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /* + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /* + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /* + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** 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()); + } + } +} 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..98f1274bb2fb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.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.resourcemanager.network.generated.fluent.models.TroubleshootingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the resource to troubleshoot. */ +@Fluent +public final class TroubleshootingParameters { + /* + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Properties of the troubleshooting resource. + */ + @JsonProperty(value = "properties", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model TroubleshootingParameters")); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model TroubleshootingParameters")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TroubleshootingParameters.class); +} 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..0de60f0c90cec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.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.fasterxml.jackson.annotation.JsonProperty; + +/** Recommended actions based on discovered issues. */ +@Fluent +public final class TroubleshootingRecommendedActions { + /* + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /* + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /* + * The uri linking to a documentation for the recommended troubleshooting actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /* + * The information from the URI for the recommended troubleshooting actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java new file mode 100644 index 0000000000000..396ee77e84a26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of TroubleshootingResult. */ +public interface TroubleshootingResult { + /** + * Gets the startTime property: The start time of the troubleshooting. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the troubleshooting. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the code property: The result code of the troubleshooting. + * + * @return the code value. + */ + String code(); + + /** + * Gets the results property: Information from troubleshooting. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner object. + * + * @return the inner object. + */ + TroubleshootingResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..adaa0d872cd4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualNetworkGatewayConnection properties. */ +@Immutable +public final class TunnelConnectionHealth { + /* + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** 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() { + } +} 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..dabbddbf64be8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of UnprepareNetworkPolicies for Subnet. */ +@Fluent +public final class UnprepareNetworkPoliciesRequest { + /* + * The name of the service for which subnet is being unprepared for. + */ + @JsonProperty(value = "serviceName") + 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java new file mode 100644 index 0000000000000..498b78749eae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the id property: Resource identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + long currentValue(); + + /** + * Gets the limit property: The limit of usage. + * + * @return the limit value. + */ + long limit(); + + /** + * Gets the name property: The name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java new file mode 100644 index 0000000000000..2156d89900e1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names. */ +@Fluent +public final class UsageName { + /* + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /* + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** 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() { + } +} 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..0bdf5d30c9967 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..e8dbb6e2094e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response 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..9cadd34fb6704 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list usages operation response. */ +@Fluent +public final class UsagesListResult { + /* + * The list network resource usages. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..f11440905e28a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UseHubGateway.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..df258ab68f478 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine. */ +@Fluent +public final class VM extends Resource { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** 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; + } + + /** {@inheritDoc} */ + @Override + public VM withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VM withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java new file mode 100644 index 0000000000000..0303204b914f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..1c4a2d7c1310a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the IP flow to be verified. */ +@Fluent +public final class VerificationIpFlowParameters { + /* + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The direction of the packet represented as a 5-tuple. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /* + * The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source + * port, which depends on the direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /* + * The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source + * port, which depends on the direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /* + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIpAddress; + + /* + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be + * specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model VerificationIpFlowParameters")); + } + if (direction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model VerificationIpFlowParameters")); + } + if (protocol() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model VerificationIpFlowParameters")); + } + if (localPort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localPort in model VerificationIpFlowParameters")); + } + if (remotePort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remotePort in model VerificationIpFlowParameters")); + } + if (localIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localIpAddress in model VerificationIpFlowParameters")); + } + if (remoteIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteIpAddress in model VerificationIpFlowParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VerificationIpFlowParameters.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java new file mode 100644 index 0000000000000..37a83526cf2ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; + +/** An immutable client-side representation of VerificationIpFlowResult. */ +public interface VerificationIpFlowResult { + /** + * Gets the access property: Indicates whether the traffic is allowed or denied. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @return the ruleName value. + */ + String ruleName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner object. + * + * @return the inner object. + */ + VerificationIpFlowResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..5cdfada474bb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VipSwaps.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.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/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..69981c7c1defb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance NIC properties. */ +@Immutable +public final class VirtualApplianceNicProperties { + /* + * NIC name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Public IP address. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * Private IP address. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /** Creates an instance of VirtualApplianceNicProperties class. */ + public VirtualApplianceNicProperties() { + } + + /** + * Get the name property: NIC name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the publicIpAddress property: Public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Get the privateIpAddress property: Private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java new file mode 100644 index 0000000000000..dc988580e2992 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..0d57a2a8dc46c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.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 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..3bb3e4ba84928 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class VirtualApplianceSkuProperties { + /* + * Virtual Appliance Vendor. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * Virtual Appliance Scale Unit. + */ + @JsonProperty(value = "bundledScaleUnit") + private String bundledScaleUnit; + + /* + * Virtual Appliance Version. + */ + @JsonProperty(value = "marketPlaceVersion") + private String marketPlaceVersion; + + /** 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() { + } +} 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..abbe63f091f49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.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.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..8034c1d175b12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + void getEffectiveVirtualHubRoutes(); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context); + + /** + * 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. + */ + void 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. + */ + void 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. + */ + void 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. + */ + void 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..556d41b75823a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualHubBgpConnections. */ +public interface VirtualHubBgpConnections { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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/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..f906af6a706a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Hub identifier. */ +@Fluent +public final class VirtualHubId { + /* + * The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub + * resource and the ExpressRoute gateway resource reside in the same subscription. + */ + @JsonProperty(value = "id") + private String id; + + /** 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() { + } +} 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..0cab378af79a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualHubIpConfigurations. */ +public interface VirtualHubIpConfigurations { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..a18d855fb306e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHub route. */ +@Fluent +public final class VirtualHubRoute { + /* + * List of all addressPrefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * NextHop ip address. + */ + @JsonProperty(value = "nextHopIpAddress") + 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() { + } +} 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..f90fcdd583563 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHub route table. */ +@Fluent +public final class VirtualHubRouteTable { + /* + * List of all routes. + */ + @JsonProperty(value = "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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java new file mode 100644 index 0000000000000..368efa892c8f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import java.util.List; + +/** An immutable client-side representation of VirtualHubRouteTableV2. */ +public interface VirtualHubRouteTableV2 { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routes property: List of all routes. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the attachedConnections property: List of all connections attached to this route table v2. + * + * @return the attachedConnections value. + */ + List attachedConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual hub route table v2 resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner object. + * + * @return the inner object. + */ + VirtualHubRouteTableV2Inner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java new file mode 100644 index 0000000000000..dcbd1110ac9b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.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; +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..04ac728c18a89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubRouteTableV2 route. */ +@Fluent +public final class VirtualHubRouteV2 { + /* + * The type of destinations. + */ + @JsonProperty(value = "destinationType") + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations") + private List destinations; + + /* + * The type of next hops. + */ + @JsonProperty(value = "nextHopType") + private String nextHopType; + + /* + * NextHops ip address. + */ + @JsonProperty(value = "nextHops") + private List nextHops; + + /** 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() { + } +} 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..39e363efb16c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.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.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. + */ + void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * 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. + */ + void 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. + */ + void 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. + */ + void 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. + */ + void 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..e2bd44af7edfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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..df37838a67f88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. */ +@Fluent +public final class VirtualNetworkBgpCommunities { + /* + * The BGP community associated with the virtual network. + */ + @JsonProperty(value = "virtualNetworkCommunity", required = true) + private String virtualNetworkCommunity; + + /* + * The BGP community associated with the region of the virtual network. + */ + @JsonProperty(value = "regionalCommunity", access = JsonProperty.Access.WRITE_ONLY) + private String regionalCommunity; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkCommunity in model VirtualNetworkBgpCommunities")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkBgpCommunities.class); +} 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..e9f43adca6e67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A reference to VirtualNetworkGateway or LocalNetworkGateway resource. */ +@Fluent +public final class VirtualNetworkConnectionGatewayReference { + /* + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property id in model VirtualNetworkConnectionGatewayReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkConnectionGatewayReference.class); +} 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..7c92d01c9e9d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkDdosProtectionStatusResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpDdosProtectionStatusResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for GetVirtualNetworkDdosProtectionStatusOperation. */ +@Fluent +public final class VirtualNetworkDdosProtectionStatusResult { + /* + * The Ddos Protection Status Result for each public ip under a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..b3086d17904a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryption.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. */ +@Fluent +public final class VirtualNetworkEncryption { + /* + * Indicates if encryption is enabled on the virtual network. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * If the encrypted VNet allows VM that does not support encryption + */ + @JsonProperty(value = "enforcement") + 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. + * + * @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. + * + * @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() { + } +} 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..2f81a318f7c85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** If the encrypted VNet allows VM that does not support encryption. */ +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. + */ + @JsonCreator + 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..ad8ce69c895ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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.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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGateway create(Context context); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of type local virtual network gateway.. + * + * @param extendedLocation The extended location of type local virtual network gateway. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configurations for virtual network gateway.. + * + * @param ipConfigurations IP configurations for virtual network gateway. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify gatewayType. */ + interface WithGatewayType { + /** + * Specifies the gatewayType property: The type of this virtual network gateway.. + * + * @param gatewayType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnType. */ + interface WithVpnType { + /** + * Specifies the vpnType property: The type of this virtual network gateway.. + * + * @param vpnType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withVpnType(VpnType vpnType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnGatewayGeneration. */ + interface WithVpnGatewayGeneration { + /** + * Specifies the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None + * if gatewayType is not VPN.. + * + * @param vpnGatewayGeneration The generation for this VirtualNetworkGateway. Must be None if gatewayType is + * not VPN. + * @return the next definition stage. + */ + WithCreate withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableBgp. */ + interface WithEnableBgp { + /** + * Specifies the enableBgp property: Whether BGP is enabled for this virtual network gateway or not.. + * + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not. + * @return the next definition stage. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enablePrivateIpAddress. */ + interface WithEnablePrivateIpAddress { + /** + * Specifies the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for + * connections or not.. + * + * @param enablePrivateIpAddress Whether private IP needs to be enabled on this gateway for connections or + * not. + * @return the next definition stage. + */ + WithCreate withEnablePrivateIpAddress(Boolean enablePrivateIpAddress); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify active. */ + interface WithActive { + /** + * Specifies the active property: ActiveActive flag.. + * + * @param active ActiveActive flag. + * @return the next definition stage. + */ + WithCreate withActive(Boolean active); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify 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); + } + } + /** + * 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/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..5e13a5e4a6392 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java @@ -0,0 +1,738 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..b61e8e319b6b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.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.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..756d9ce497ee0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGatewayConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListResult { + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..14d5044c03113 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..d15d9cb0a5e30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionPropertiesFormat.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.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..4b19f837b3877 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a58dfe67db546 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..2df9e3a045b35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..e5522510afa61 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..9f12ebdf28379 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration for virtual network gateway. */ +@Fluent +public final class VirtualNetworkGatewayIpConfiguration extends SubResource { + /* + * Properties of the virtual network gateway ip configuration. + */ + @JsonProperty(value = "properties") + private VirtualNetworkGatewayIpConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..00df78eca34ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the VirtualNetworkGatewayListConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayListConnectionsResult { + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..209ab6f5b8972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGateways API service call. */ +@Fluent +public final class VirtualNetworkGatewayListResult { + /* + * A list of VirtualNetworkGateway resources that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..af570d4ffdd67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.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.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..c53f0142fc04c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.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 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..1b56100053991 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroup.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayPolicyGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualNetworkGatewayPolicyGroup. */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroup extends SubResource { + /* + * Properties of tVirtualNetworkGatewayPolicyGroup. + */ + @JsonProperty(value = "properties") + private VirtualNetworkGatewayPolicyGroupProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..8c2f3cd6c8d72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroupMember.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.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn Client Connection configuration PolicyGroup member. */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroupMember { + /* + * Name of the VirtualNetworkGatewayPolicyGroupMember. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Vpn Policy member attribute type. + */ + @JsonProperty(value = "attributeType") + private VpnPolicyMemberAttributeType attributeType; + + /* + * The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + */ + @JsonProperty(value = "attributeValue") + 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() { + } +} 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..1982d44f9604b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualNetworkGatewaySku details. */ +@Fluent +public final class VirtualNetworkGatewaySku { + /* + * Gateway SKU name. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /* + * Gateway SKU tier. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /* + * The capacity. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private Integer capacity; + + /** 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() { + } +} 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..a290120dbf442 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..22689d0fa9fee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..a7fe75b51abb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..726b3d14a0d8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..6f857c11847ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworks API service call. */ +@Fluent +public final class VirtualNetworkListResult { + /* + * A list of VirtualNetwork resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..096616a76e4d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the virtual networks GetUsage API service call. */ +@Fluent +public final class VirtualNetworkListUsageResult { + /* + * VirtualNetwork usage stats. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..6f45c239e8461 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java @@ -0,0 +1,603 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; + +/** An immutable client-side representation of VirtualNetworkPeering. */ +public interface VirtualNetworkPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * Gets the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + * + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * Gets the allowGatewayTransit property: If gateway links can be used in remote virtual networking to link to this + * virtual network. + * + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * Gets the useRemoteGateways property: If remote gateways can be used on this virtual network. If the flag is set + * to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote + * virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual + * network already has a gateway. + * + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * Gets the remoteVirtualNetwork property: The reference to the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * Gets the remoteAddressSpace property: The reference to the address space peered with the remote virtual network. + * + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * Gets the remoteVirtualNetworkAddressSpace property: The reference to the current address space of the remote + * virtual network. + * + * @return the remoteVirtualNetworkAddressSpace value. + */ + AddressSpace remoteVirtualNetworkAddressSpace(); + + /** + * Gets the remoteBgpCommunities property: The reference to the remote virtual network's Bgp Communities. + * + * @return the remoteBgpCommunities value. + */ + VirtualNetworkBgpCommunities remoteBgpCommunities(); + + /** + * Gets the 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 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.WithRemoteAddressSpace, + DefinitionStages.WithRemoteVirtualNetworkAddressSpace, + DefinitionStages.WithRemoteBgpCommunities, + DefinitionStages.WithPeeringState, + DefinitionStages.WithPeeringSyncLevel, + DefinitionStages.WithDoNotVerifyRemoteGateways, + DefinitionStages.WithSyncRemoteAddressSpace { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkPeering create(Context context); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + WithCreate withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + WithCreate withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + WithCreate withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Begins update for the VirtualNetworkPeering resource. + * + * @return the stage of resource update. + */ + VirtualNetworkPeering.Update update(); + + /** The template for VirtualNetworkPeering update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAllowVirtualNetworkAccess, + UpdateStages.WithAllowForwardedTraffic, + UpdateStages.WithAllowGatewayTransit, + UpdateStages.WithUseRemoteGateways, + UpdateStages.WithRemoteVirtualNetwork, + UpdateStages.WithRemoteAddressSpace, + UpdateStages.WithRemoteVirtualNetworkAddressSpace, + UpdateStages.WithRemoteBgpCommunities, + UpdateStages.WithPeeringState, + UpdateStages.WithPeeringSyncLevel, + UpdateStages.WithDoNotVerifyRemoteGateways, + UpdateStages.WithSyncRemoteAddressSpace { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkPeering apply(Context context); + } + /** The VirtualNetworkPeering update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualNetworkPeering update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering update allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + Update withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + Update withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering update allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + Update withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + Update withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java new file mode 100644 index 0000000000000..a95a335d54933 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..c80500647ac4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. */ +@Fluent +public final class VirtualNetworkPeeringListResult { + /* + * The peerings in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..92028457e61e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..ce01be9649374 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkPeerings. */ +public interface VirtualNetworkPeerings { + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..beb432ac87049 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..c1205d20c1f05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a7140599b5d19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.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.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..38d68bf21b807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualNetworkTap API service call. */ +@Fluent +public final class VirtualNetworkTapListResult { + /* + * A list of VirtualNetworkTaps in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..fc91e5a2567d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapPropertiesFormat.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.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..fbf683db204e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkTaps. */ +public interface VirtualNetworkTaps { + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String tapName); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String tapName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..dffc0d4bdb35c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; + +/** An immutable client-side representation of VirtualNetworkUsage. */ +public interface VirtualNetworkUsage { + /** + * Gets the currentValue property: Indicates number of IPs used from the Subnet. + * + * @return the currentValue value. + */ + Double currentValue(); + + /** + * Gets the id property: Subnet identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the limit property: Indicates the size of the subnet. + * + * @return the limit value. + */ + Double limit(); + + /** + * Gets the name property: The name containing common and localized value for usage. + * + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * Gets the unit property: Usage units. Returns 'Count'. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner object. + * + * @return the inner object. + */ + VirtualNetworkUsageInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java new file mode 100644 index 0000000000000..1cb44d3575d0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Usage strings container. */ +@Immutable +public final class VirtualNetworkUsageName { + /* + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /* + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** 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() { + } +} 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..576e9e280268e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.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.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..54c7dca4ea9d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.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.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..83c84230cd1f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterAutoScaleConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualHub Router autoscale configuration. */ +@Fluent +public final class VirtualRouterAutoScaleConfiguration { + /* + * The minimum number of scale units for VirtualHub Router. + */ + @JsonProperty(value = "minCapacity") + 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() { + } +} 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..6c541dc0c410b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouters API service call. */ +@Fluent +public final class VirtualRouterListResult { + /* + * List of Virtual Routers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + 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()); + } + } +} 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..89339f3a5b034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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..8b64ecd02588d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouterPeerings API service call. */ +@Fluent +public final class VirtualRouterPeeringListResult { + /* + * List of VirtualRouterPeerings in a VirtualRouter. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** 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()); + } + } +} 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..88c1203fef32b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualRouterPeerings. */ +public interface VirtualRouterPeerings { + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @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..13e94b9313605 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualRouters. */ +public interface VirtualRouters { + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @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..1128f5f1ac06b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.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.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..022af40f87e3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvider { + /* + * Name of the security provider. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Url of the security provider. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Name of the security provider. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private VirtualWanSecurityProviderType type; + + /** 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() { + } +} 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..41816ae2fb034 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..44a392862636d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import java.util.List; + +/** An immutable client-side representation of VirtualWanSecurityProviders. */ +public interface VirtualWanSecurityProviders { + /** + * Gets the supportedProviders property: List of VirtualWAN security providers. + * + * @return the supportedProviders value. + */ + List supportedProviders(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner object. + * + * @return the inner object. + */ + VirtualWanSecurityProvidersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java new file mode 100644 index 0000000000000..e912ed7252d5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Wan Vpn profile parameters Vpn profile generation. */ +@Fluent +public final class VirtualWanVpnProfileParameters { + /* + * VpnServerConfiguration partial resource uri with which VirtualWan is associated to. + */ + @JsonProperty(value = "vpnServerConfigurationResourceId") + private String vpnServerConfigurationResourceId; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** 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() { + } +} 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..95f4255edd07d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualWans. */ +public interface VirtualWans { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..7aacf18e36b24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetLocalRouteOverrideCriteria.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..86f5ac30ae773 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of routes that control routing from VirtualHub into a virtual network connection. */ +@Fluent +public final class VnetRoute { + /* + * Configuration for static routes on this HubVnetConnection. + */ + @JsonProperty(value = "staticRoutesConfig") + private StaticRoutesConfig staticRoutesConfig; + + /* + * List of all Static Routes. + */ + @JsonProperty(value = "staticRoutes") + private List staticRoutes; + + /* + * The list of references to HubBgpConnection objects. + */ + @JsonProperty(value = "bgpConnections", access = JsonProperty.Access.WRITE_ONLY) + 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()); + } + } +} 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..fb57582112709 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VngClientConnectionConfiguration.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.resourcemanager.network.generated.fluent.models.VngClientConnectionConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ + @JsonProperty(value = "properties") + private VngClientConnectionConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..0a4678013087c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a467e0e526c9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnClientConfiguration for P2S client. */ +@Fluent +public final class VpnClientConfiguration { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /* + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /* + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /* + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /* + * VPN authentication types for the virtual network gateway.. + */ + @JsonProperty(value = "vpnAuthenticationTypes") + private List vpnAuthenticationTypes; + + /* + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VirtualNetworkGateway resource for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /* + * The radius secret property of the VirtualNetworkGateway resource for vpn client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /* + * The radiusServers property for multiple radius server configuration. + */ + @JsonProperty(value = "radiusServers") + private List radiusServers; + + /* + * The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /* + * per ip address pool connection policy for virtual network gateway P2S client. + */ + @JsonProperty(value = "vngClientConnectionConfigurations") + 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()); + } + } +} 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..5e3dbbb1cf6c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnClientConnectionHealth properties. */ +@Fluent +public final class VpnClientConnectionHealth { + /* + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIngressBytesTransferred; + + /* + * Total of the Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEgressBytesTransferred; + + /* + * The total of p2s vpn clients connected at this time to this P2SVpnGateway. + */ + @JsonProperty(value = "vpnClientConnectionsCount") + private Integer vpnClientConnectionsCount; + + /* + * List of allocated ip addresses to the connected p2s vpn clients. + */ + @JsonProperty(value = "allocatedIpAddresses") + private List allocatedIpAddresses; + + /** 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() { + } +} 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..a2b8114382b2d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client connection health detail. */ +@Immutable +public final class VpnClientConnectionHealthDetail { + /* + * The vpn client Id. + */ + @JsonProperty(value = "vpnConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionId; + + /* + * The duration time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionDuration", access = JsonProperty.Access.WRITE_ONLY) + private Long vpnConnectionDuration; + + /* + * The start time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionTime", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionTime; + + /* + * The public Ip of a connected vpn client. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * The assigned private Ip of a connected vpn client. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The user name of a connected vpn client. + */ + @JsonProperty(value = "vpnUserName", access = JsonProperty.Access.WRITE_ONLY) + private String vpnUsername; + + /* + * The max band width. + */ + @JsonProperty(value = "maxBandwidth", access = JsonProperty.Access.WRITE_ONLY) + private Long maxBandwidth; + + /* + * The egress packets per second. + */ + @JsonProperty(value = "egressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressPacketsTransferred; + + /* + * The egress bytes per second. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress packets per second. + */ + @JsonProperty(value = "ingressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressPacketsTransferred; + + /* + * The ingress bytes per second. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The max packets transferred per second. + */ + @JsonProperty(value = "maxPacketsPerSecond", access = JsonProperty.Access.WRITE_ONLY) + private Long maxPacketsPerSecond; + + /** 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() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java new file mode 100644 index 0000000000000..b22ace51ba6d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import java.util.List; + +/** An immutable client-side representation of VpnClientConnectionHealthDetailListResult. */ +public interface VpnClientConnectionHealthDetailListResult { + /** + * Gets the value property: List of vpn client connection health. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner object. + * + * @return the inner object. + */ + VpnClientConnectionHealthDetailListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..10b45b05cac88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; + +/** An immutable client-side representation of VpnClientIPsecParameters. */ +public interface VpnClientIPsecParameters { + /** + * Gets the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + + /** + * Gets the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * Gets the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * Gets the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * Gets the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * Gets the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * Gets the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * Gets the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner object. + * + * @return the inner object. + */ + VpnClientIPsecParametersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java new file mode 100644 index 0000000000000..6da7e0e102d9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class VpnClientParameters { + /* + * VPN client Processor Architecture. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /* + * The public certificate data for the radius server authentication certificate as a Base-64 encoded string. + * Required only if external radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /* + * A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for + * external radius based authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** 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() { + } +} 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..bff329914a63b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..8829296c3ae65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRevokedCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client revoked certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRevokedCertificate extends SubResource { + /* + * Properties of the vpn client revoked certificate. + */ + @JsonProperty(value = "properties") + private VpnClientRevokedCertificatePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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(); + } + } +} 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..05b590f0ba126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRootCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client root certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRootCertificate extends SubResource { + /* + * Properties of the vpn client root certificate. + */ + @JsonProperty(value = "properties", required = true) + 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VpnClientRootCertificate")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientRootCertificate.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java new file mode 100644 index 0000000000000..111739abeb6f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import java.util.List; + +/** An immutable client-side representation of VpnConnection. */ +public interface VpnConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the remoteVpnSite property: Id of the connected vpn site. + * + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * Gets the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @return the dpdTimeoutSeconds value. + */ + Integer dpdTimeoutSeconds(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * Gets the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * Gets the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * Gets the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + List trafficSelectorPolicies(); + + /** + * Gets the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @return the vpnLinkConnections value. + */ + List vpnLinkConnections(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner object. + * + * @return the inner object. + */ + VpnConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..3b2888540ed59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStartParameters { + /* + * Start Packet capture parameters on vpn connection. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** 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() { + } +} 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..7c5597ef92c5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStopParameters { + /* + * SAS url for packet capture on vpn connection. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** 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() { + } +} 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..9b5e8a556fca9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..f869149286a69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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..9bcbd5ea2434f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn device configuration script generation parameters. */ +@Fluent +public final class VpnDeviceScriptParameters { + /* + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /* + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** 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() { + } +} 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..b34fac72111e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.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.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..c4b2e303ea71d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..eeb4f36dc894a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Configuration of a VPN Gateway Resource. */ +@Fluent +public final class VpnGatewayIpConfiguration { + /* + * The identifier of the IP configuration for a VPN Gateway. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The public IP address of this IP configuration. + */ + @JsonProperty(value = "publicIpAddress") + private String publicIpAddress; + + /* + * The private IP address of this IP configuration. + */ + @JsonProperty(value = "privateIpAddress") + private String privateIpAddress; + + /** 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() { + } +} 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..99cc527a07d47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.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.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..d78286d111bc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Start packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStartParameters { + /* + * Start Packet capture parameters on vpn gateway. + */ + @JsonProperty(value = "filterData") + 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() { + } +} 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..f05543c85a1bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStopParameters { + /* + * SAS url for packet capture on vpn gateway. + */ + @JsonProperty(value = "sasUrl") + 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() { + } +} 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..5d6a958950c48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..07887519dfc6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.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 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..cde71ddca2832 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BGP settings details for a link. */ +@Fluent +public final class VpnLinkBgpSettings { + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** 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() { + } +} 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..03280f6c3840e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..7e445ac48f059 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of VpnLinkConnections. */ +public interface VpnLinkConnections { + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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..00f8638a6385b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of properties of a link provider. */ +@Fluent +public final class VpnLinkProviderProperties { + /* + * Name of the link provider. + */ + @JsonProperty(value = "linkProviderName") + private String linkProviderName; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + 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() { + } +} 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..dd0f17e4a87d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn NatRule mapping. */ +@Fluent +public final class VpnNatRuleMapping { + /* + * Address space for Vpn NatRule mapping. + */ + @JsonProperty(value = "addressSpace") + private String addressSpace; + + /* + * Port range for Vpn NatRule mapping. + */ + @JsonProperty(value = "portRange") + 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() { + } +} 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..7114cf43f5f60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..90ef5f0ac157d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..0b2eee959989d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Start packet capture parameters on virtual network gateway. */ +@Fluent +public final class VpnPacketCaptureStartParameters { + /* + * Start Packet capture parameters. + */ + @JsonProperty(value = "filterData") + 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() { + } +} 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..c958281f275b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnPacketCaptureStopParameters { + /* + * SAS url for packet capture on virtual network gateway. + */ + @JsonProperty(value = "sasUrl") + 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() { + } +} 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..ea7bb3dfe15b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPolicyMemberAttributeType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..a4d9b1dc51032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; + +/** An immutable client-side representation of VpnProfileResponse. */ +public interface VpnProfileResponse { + /** + * Gets the profileUrl property: URL to the VPN profile. + * + * @return the profileUrl value. + */ + String profileUrl(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner object. + * + * @return the inner object. + */ + VpnProfileResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java new file mode 100644 index 0000000000000..fcc5a0f63946f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Radius client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusClientRootCertificate { + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Radius client root certificate thumbprint. + */ + @JsonProperty(value = "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() { + } +} 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..4062780d4f451 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Radius Server root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusServerRootCertificate { + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + 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() { + } +} 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..5124884516ef3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the revoked VPN client certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRevokedCertificate { + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "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() { + } +} 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..8f5a2cf873ff9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of VPN client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRootCertificate { + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + 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() { + } +} 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..9a008ed28f565 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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..ebea207f77918 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroup.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.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..012c865e19320 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroupMember.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.fasterxml.jackson.annotation.JsonProperty; + +/** VpnServerConfiguration PolicyGroup member. */ +@Fluent +public final class VpnServerConfigurationPolicyGroupMember { + /* + * Name of the VpnServerConfigurationPolicyGroupMember. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Vpn Policy member attribute type. + */ + @JsonProperty(value = "attributeType") + private VpnPolicyMemberAttributeType attributeType; + + /* + * The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + */ + @JsonProperty(value = "attributeValue") + 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() { + } +} 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..76e6ac7e88e30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.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 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..2fb54d3c9fc18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. */ +public interface VpnServerConfigurationsAssociatedWithVirtualWans { + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName); + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response. + */ + VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java new file mode 100644 index 0000000000000..92934fbbc3ee0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import java.util.List; + +/** An immutable client-side representation of VpnServerConfigurationsResponse. */ +public interface VpnServerConfigurationsResponse { + /** + * Gets the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @return the vpnServerConfigurationResourceIds value. + */ + List vpnServerConfigurationResourceIds(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner + * object. + * + * @return the inner object. + */ + VpnServerConfigurationsResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java new file mode 100644 index 0000000000000..4078cc7af1eeb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.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.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..da8cd1a2bb6a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; + +/** An immutable client-side representation of VpnSiteLink. */ +public interface VpnSiteLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the linkProperties property: The link provider properties. + * + * @return the linkProperties value. + */ + VpnLinkProviderProperties linkProperties(); + + /** + * Gets the ipAddress property: The ip-address for the vpn-site-link. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the fqdn property: FQDN of vpn-site-link. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + VpnLinkBgpSettings bgpProperties(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site link resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner object. + * + * @return the inner object. + */ + VpnSiteLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java new file mode 100644 index 0000000000000..379e898744f47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.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.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 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..e477868bd67eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSiteLinkConnections. */ +public interface VpnSiteLinkConnections { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..7c0074e9982c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSiteLinks. */ +public interface VpnSiteLinks { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..f15d1d1424d40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSites. */ +public interface VpnSites { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..53515b2c5e9dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of VpnSitesConfigurations. */ +public interface VpnSitesConfigurations { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request); + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java new file mode 100644 index 0000000000000..13815d8aa0c81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..bb3818d8a3303 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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"); + + /** + * 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. + */ + @JsonCreator + 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..3f53195a92ce4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of a web application rule. */ +@Fluent +public final class WebApplicationFirewallCustomRule { + /* + * The name of the resource that is unique within a policy. This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ + @JsonProperty(value = "state") + private WebApplicationFirewallState state; + + /* + * The rule type. + */ + @JsonProperty(value = "ruleType", required = true) + private WebApplicationFirewallRuleType ruleType; + + /* + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /* + * Type of Actions. + */ + @JsonProperty(value = "action", required = true) + private WebApplicationFirewallAction action; + + /** 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 ruleType property: The rule type. + * + * @return the ruleType value. + */ + public WebApplicationFirewallRuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: The rule type. + * + * @param ruleType the ruleType value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRuleType(WebApplicationFirewallRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the matchConditions property: List of match conditions. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: List of match conditions. + * + * @param matchConditions the matchConditions value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get the action property: Type of Actions. + * + * @return the action value. + */ + public WebApplicationFirewallAction action() { + return this.action; + } + + /** + * Set the action property: Type of Actions. + * + * @param action the action value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withAction(WebApplicationFirewallAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleType in model WebApplicationFirewallCustomRule")); + } + if (matchConditions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchConditions in model WebApplicationFirewallCustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model WebApplicationFirewallCustomRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallCustomRule.class); +} 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..12e05da667d33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..36ab3f170b25c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..8041809ed0693 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..199e96382c275 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..3a8aa865945ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.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 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..9f444be17390c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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..9866a894e9bf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.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.annotation.Immutable; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy + * objects and a URL link to get the next set of results. + */ +@Immutable +public final class WebApplicationFirewallPolicyListResult { + /* + * List of WebApplicationFirewallPolicies within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..400c35e1fe5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..66474b1685fc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The rule type. */ +public final class WebApplicationFirewallRuleType extends ExpandableStringEnum { + /** Static value MatchRule for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType MATCH_RULE = fromString("MatchRule"); + + /** Static value Invalid for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType INVALID = fromString("Invalid"); + + /** + * Creates 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. + */ + @JsonCreator + 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/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..4249e7b7fe1f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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. + */ + @JsonCreator + 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..5f2443e22feea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.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 com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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..3856174584fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WebCategories. */ +public interface WebCategories { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @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..4b076d6d32e46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java new file mode 100644 index 0000000000000..adbbe4531ffac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ffb4499d26afb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.network.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.network.generated; + exports com.azure.resourcemanager.network.generated.fluent; + exports com.azure.resourcemanager.network.generated.fluent.models; + exports com.azure.resourcemanager.network.generated.models; + + opens com.azure.resourcemanager.network.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.network.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/network/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..a4086a5cbb6f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsCreateOrUpdateSamples.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.NetworkManagerSecurityGroupItem; +import java.util.Arrays; + +/** Samples for AdminRuleCollections CreateOrUpdate. */ +public final class AdminRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3ea02c04d6359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsDeleteSamples.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 AdminRuleCollections Delete. */ +public final class AdminRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7667634d81f9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsGetSamples.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 AdminRuleCollections Get. */ +public final class AdminRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..554ef9c2e4606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsListSamples.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 AdminRuleCollections List. */ +public final class AdminRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..9bb65536f4854 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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..4b27e749c3b6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesDeleteSamples.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 AdminRules Delete. */ +public final class AdminRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..65de691a31aee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesGetSamples.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; + +/** Samples for AdminRules Get. */ +public final class AdminRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..22c585cc0a94d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesListSamples.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 AdminRules List. */ +public final class AdminRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bab78898c3950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.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 ApplicationGatewayPrivateEndpointConnections Delete. */ +public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1a123a59fced7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.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 ApplicationGatewayPrivateEndpointConnections Get. */ +public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e4fcda99e7e66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationGatewayPrivateEndpointConnections List. */ +public final class ApplicationGatewayPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d21541d430782 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.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.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/2022-09-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..46a0d0bbabb36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationGatewayPrivateLinkResources List. */ +public final class ApplicationGatewayPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6c7bf2f62ed4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsDefaultGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b918bf3faf0ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..948fbb4861920 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.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.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/2022-09-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..113b76a5bacd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b435d39ef5fff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysCreateOrUpdateSamples.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.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.ApplicationGatewayLoadDistributionAlgorithm; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule; +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.ApplicationGatewayUrlPathMap; +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/2022-09-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(), + new ApplicationGatewayBackendAddress())))) + .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)))) + .withUrlPathMaps( + Arrays + .asList( + new ApplicationGatewayUrlPathMap() + .withName("pathMap1") + .withDefaultBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")) + .withDefaultBackendHttpSettings( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs")) + .withDefaultRewriteRuleSet( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")) + .withDefaultLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")) + .withPathRules( + Arrays + .asList( + new ApplicationGatewayPathRule() + .withName("apiPaths") + .withPaths(Arrays.asList("/api", "/v1/api")) + .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")) + .withRewriteRuleSet( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")) + .withLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")))))) + .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")) + .withLoadDistributionPolicy( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")), + new ApplicationGatewayRequestRoutingRule() + .withName("appgwPathBasedRule") + .withRuleType(ApplicationGatewayRequestRoutingRuleType.PATH_BASED_ROUTING) + .withPriority(20) + .withHttpListener( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener")) + .withUrlPathMap( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1")))) + .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"))))))) + .withLoadDistributionPolicies( + Arrays + .asList( + new ApplicationGatewayLoadDistributionPolicy() + .withName("ldp1") + .withLoadDistributionTargets( + Arrays + .asList( + new ApplicationGatewayLoadDistributionTarget() + .withName("ld11") + .withWeightPerServer(40) + .withBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")), + new ApplicationGatewayLoadDistributionTarget() + .withName("ld11") + .withWeightPerServer(60) + .withBackendAddressPool( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1")))) + .withLoadDistributionAlgorithm(ApplicationGatewayLoadDistributionAlgorithm.ROUND_ROBIN))) + .withGlobalConfiguration( + new ApplicationGatewayGlobalConfiguration() + .withEnableRequestBuffering(true) + .withEnableResponseBuffering(true)) + .create(); + } + + @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..d10bf759c5383 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..ad28c5d618d9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e4df6642fe990 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.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 GetSslPredefinedPolicy. */ +public final class ApplicationGatewaysGetSslPredefinedPolicySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e791df913654c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..225664086eba5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..08763ec8528f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d73d2acb39aec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..57cb9605bc038 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. */ +public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8c508a7484b61 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..046c29b3fd950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationGateways ListByResourceGroup. */ +public final class ApplicationGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e4ba679ad9f1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationGateways List. */ +public final class ApplicationGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..53e1143c620e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..22e78738d43da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..28f329928489e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..29b01a8748891 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.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 ApplicationSecurityGroups CreateOrUpdate. */ +public final class ApplicationSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a9445453f770b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationSecurityGroups Delete. */ +public final class ApplicationSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..601a5e084a8e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..83a304ddc0bfd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationSecurityGroups ListByResourceGroup. */ +public final class ApplicationSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..070a94544196d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ApplicationSecurityGroups List. */ +public final class ApplicationSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..03a6b73b75f31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..7076840b306c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d63ea1804eb82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..5b56e7dee6618 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.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 AvailablePrivateEndpointTypes ListByResourceGroup. */ +public final class AvailablePrivateEndpointTypesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ae207273b2cf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AvailablePrivateEndpointTypes List. */ +public final class AvailablePrivateEndpointTypesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1e2a201b83246 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AvailableResourceGroupDelegations List. */ +public final class AvailableResourceGroupDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..14d2ee0b8c5f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AvailableServiceAliases ListByResourceGroup. */ +public final class AvailableServiceAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..66934ee9d90da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..826c5e572dbf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AzureFirewallFqdnTags List. */ +public final class AzureFirewallFqdnTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..53f5156bc645a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList("1", "2", "3")) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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", "value1", "key2", "value2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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", "value1")) + .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/2022-09-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", "value1")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections( + Arrays + .asList( + new AzureFirewallApplicationRuleCollection() + .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() + .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() + .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(); + } + + @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..4a4de88148996 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..17b70786d7189 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.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.generated; + +/** Samples for AzureFirewalls GetByResourceGroup. */ +public final class AzureFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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..88580e078af0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AzureFirewalls ListByResourceGroup. */ +public final class AzureFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ce7ca45508785 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListLearnedPrefixesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AzureFirewalls ListLearnedPrefixes. */ +public final class AzureFirewallsListLearnedPrefixesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..19bb2677f50ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for AzureFirewalls List. */ +public final class AzureFirewallsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/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..457ee2f4cee35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..8b93018041d8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsCreateOrUpdateSamples.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.BastionHostIpConfiguration; +import java.util.Arrays; + +/** Samples for BastionHosts CreateOrUpdate. */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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(); + } +} 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..729539ce40fc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e0691d9d9e546 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..30f2dba0844d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for BastionHosts ListByResourceGroup. */ +public final class BastionHostsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..47ba8ce924c86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for BastionHosts List. */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..164401810d0be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..3513ef48aa87f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b024205e3fec2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsCreateOrUpdateSamples.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.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/2022-09-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..6ce61c928ce3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsDeleteSamples.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 ConfigurationPolicyGroups Delete. */ +public final class ConfigurationPolicyGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..da752a62df90f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fa0a02564c0a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsListByVpnServerConfigurationSamples.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 ConfigurationPolicyGroups ListByVpnServerConfiguration. */ +public final class ConfigurationPolicyGroupsListByVpnServerConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7a5934775b1d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsCreateOrUpdateSamples.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.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.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 java.util.Arrays; + +/** Samples for ConnectionMonitors CreateOrUpdate. */ +public final class ConnectionMonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..820ff2a04b8b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b7a36f886bdec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..148a550a0f9c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..9dc89b1313fa8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..acf818cf4bac1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1845ce7550033 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0bcbccdff3d44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..cedb9153ff218 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsCreateOrUpdateSamples.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.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/2022-09-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..d285692d291a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsDeleteSamples.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 ConnectivityConfigurations Delete. */ +public final class ConnectivityConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..39ae418cba2fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsGetSamples.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 ConnectivityConfigurations Get. */ +public final class ConnectivityConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..72f150ba4d7f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsListSamples.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 ConnectivityConfigurations List. */ +public final class ConnectivityConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e120994b8d4e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesCreateOrUpdateSamples.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 CustomIpPrefixes CreateOrUpdate. */ +public final class CustomIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0314b4a7c462b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3308ffd6394c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..86a6858257bc0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for CustomIpPrefixes ListByResourceGroup. */ +public final class CustomIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..eb006fd1b24ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3fcec3cfd8959 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..325a4ec7ed209 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.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 DdosCustomPolicies CreateOrUpdate. */ +public final class DdosCustomPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ed0bfefd8be05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8de30f3c41695 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..5fdd9216ec904 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..b6001c4a436b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansCreateOrUpdateSamples.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 DdosProtectionPlans CreateOrUpdate. */ +public final class DdosProtectionPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1a7db63741ee5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..26fce13394104 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3bb0c1181c6dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for DdosProtectionPlans ListByResourceGroup. */ +public final class DdosProtectionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6739477f57e9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..41570ee6ac5af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..063d69d2e780f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b5c8c56cafb9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..7f697c68b4224 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationCreateOrUpdateSamples.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.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/2022-09-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..1b4b3ac57f262 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..25ff16acff003 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..460b096079ca5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..921831125e0d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b551cd8f560c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.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 CreateOrUpdate. */ +public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c61d4acffe915 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.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 ExpressRouteCircuitAuthorizations Delete. */ +public final class ExpressRouteCircuitAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..05ecf93e04103 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.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 ExpressRouteCircuitAuthorizations Get. */ +public final class ExpressRouteCircuitAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..27f9e2a7e77ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCircuitAuthorizations List. */ +public final class ExpressRouteCircuitAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..31973e610c1f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.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.Ipv6CircuitConnectionConfig; + +/** Samples for ExpressRouteCircuitConnections CreateOrUpdate. */ +public final class ExpressRouteCircuitConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e32e0a1ff5d62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.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 ExpressRouteCircuitConnections Delete. */ +public final class ExpressRouteCircuitConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2ab5916e78d30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.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 ExpressRouteCircuitConnections Get. */ +public final class ExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ea5a4a2e3d555 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.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 ExpressRouteCircuitConnections List. */ +public final class ExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..eb2caa7f830f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.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 ExpressRouteCircuitPeerings CreateOrUpdate. */ +public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7bb1ca166a52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsDeleteSamples.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 ExpressRouteCircuitPeerings Delete. */ +public final class ExpressRouteCircuitPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3458d7a7c70fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsGetSamples.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 ExpressRouteCircuitPeerings Get. */ +public final class ExpressRouteCircuitPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1d3a4b8f54823 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCircuitPeerings List. */ +public final class ExpressRouteCircuitPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4198d263959bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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") + .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..f2cd7d2db5e3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..442bab7ce0b75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..7c7bb4c9949e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetPeeringStatsSamples.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 ExpressRouteCircuits GetPeeringStats. */ +public final class ExpressRouteCircuitsGetPeeringStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e5d795b5f13c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCircuits GetStats. */ +public final class ExpressRouteCircuitsGetStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..63872901d19a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListArpTableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b620c3df5b0c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCircuits ListByResourceGroup. */ +public final class ExpressRouteCircuitsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1edc2a3e132bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fb4faac411945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.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 ExpressRouteCircuits ListRoutesTableSummary. */ +public final class ExpressRouteCircuitsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..87a271312d838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCircuits List. */ +public final class ExpressRouteCircuitsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..de71d1169e585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..d29a003afb745 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.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.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/2022-09-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..9f6ff67d80634 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.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 ExpressRouteConnections Delete. */ +public final class ExpressRouteConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..9f13876c7d036 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.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 ExpressRouteConnections Get. */ +public final class ExpressRouteConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b1c1c826e06bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..cbeb975278077 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.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.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/2022-09-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..5674f915348cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.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 ExpressRouteCrossConnectionPeerings Delete. */ +public final class ExpressRouteCrossConnectionPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ed03bcdef97f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.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 ExpressRouteCrossConnectionPeerings Get. */ +public final class ExpressRouteCrossConnectionPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d46888206545b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.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 ExpressRouteCrossConnectionPeerings List. */ +public final class ExpressRouteCrossConnectionPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8a5672de67663 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.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.ServiceProviderProvisioningState; + +/** Samples for ExpressRouteCrossConnections CreateOrUpdate. */ +public final class ExpressRouteCrossConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..60f2d85ed315f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.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 GetByResourceGroup. */ +public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..00a39b116127f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.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 ExpressRouteCrossConnections ListArpTable. */ +public final class ExpressRouteCrossConnectionsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..90d3de8a4ac75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.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 ExpressRouteCrossConnections ListByResourceGroup. */ +public final class ExpressRouteCrossConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8aa17735c27b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.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 ExpressRouteCrossConnections ListRoutesTable. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8f485db769c91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.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 ExpressRouteCrossConnections ListRoutesTableSummary. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3ad644a8c7b1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteCrossConnections List. */ +public final class ExpressRouteCrossConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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(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..43408ed9099e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..460850a52ca8b --- /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/2022-09-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..2e135911024c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..47d9f92ed3a10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.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 ExpressRouteGateways GetByResourceGroup. */ +public final class ExpressRouteGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2ea4829ad8a7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListByResourceGroupSamples.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 ExpressRouteGateways ListByResourceGroup. */ +public final class ExpressRouteGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f903b9f9bcfaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteGateways ListBySubscription. */ +public final class ExpressRouteGatewaysListBySubscriptionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..491724699768a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..af6ad7d22db42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3c7890e629198 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..ec8c8550d2e4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsCreateOrUpdateSamples.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 CreateOrUpdate. */ +public final class ExpressRoutePortAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b293c3cc0021c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.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 ExpressRoutePortAuthorizations Delete. */ +public final class ExpressRoutePortAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7a30eadf462bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.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 ExpressRoutePortAuthorizations Get. */ +public final class ExpressRoutePortAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e40ef54c3eabd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRoutePortAuthorizations List. */ +public final class ExpressRoutePortAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bd60df827df2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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..0b47f5bfe61ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f1e9cb9f4daa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.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.GenerateExpressRoutePortsLoaRequest; + +/** Samples for ExpressRoutePorts GenerateLoa. */ +public final class ExpressRoutePortsGenerateLoaSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..cdde3e1e74b1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..5849f5c4354f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRoutePorts ListByResourceGroup. */ +public final class ExpressRoutePortsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..884372d5a5476 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2a68b5863b91a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRoutePortsLocations Get. */ +public final class ExpressRoutePortsLocationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bc6ff0e1586e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRoutePortsLocations List. */ +public final class ExpressRoutePortsLocationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..eb42bdcac9a29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..13f5027b4362d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteProviderPortsLocationListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ExpressRouteProviderPortsLocation List. */ +public final class ExpressRouteProviderPortsLocationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..02ce74574c98e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..4440f3afd5fa1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.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.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.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/2022-09-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", "value1")) + .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) + .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(); + } + + @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..e21bbb438f023 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..04a91f82024ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..9e7c0882b2ec7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for FirewallPolicies ListByResourceGroup. */ +public final class FirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c063c392e6d46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for FirewallPolicies List. */ +public final class FirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..569164ab73791 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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/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..7826dbc453ce7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.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.SignatureOverridesFilterValuesQuery; + +/** Samples for FirewallPolicyIdpsSignaturesFilterValues List. */ +public final class FirewallPolicyIdpsSignaturesFilterValuesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0ca2d334208ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesListSamples.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.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/2022-09-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..7ecdbb3657277 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..bbfd4f702048f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b22c344f29979 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.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.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/2022-09-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); + } + + @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..17348047b3613 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.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.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/2022-09-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); + } + + @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/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..2d890dc29d5fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.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.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.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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup. + * + * @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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup With IpGroups. + * + * @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/2022-09-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json + */ + /** + * Sample code: Create FirewallPolicyRuleCollectionGroup 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/2022-09-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json + */ + /** + * Sample code: Create FirewallPolicyNatRuleCollectionGroup. + * + * @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(); + } +} 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..b4ec238eb4870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.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 FirewallPolicyRuleCollectionGroups Delete. */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1429a2d1534c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.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.generated; + +/** Samples for FirewallPolicyRuleCollectionGroups Get. */ +public final class FirewallPolicyRuleCollectionGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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/2022-09-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..4e9891bc624f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.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; + +/** Samples for FirewallPolicyRuleCollectionGroups List. */ +public final class FirewallPolicyRuleCollectionGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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..47c61dca6b39a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsCreateOrUpdateSamples.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.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatType; + +/** Samples for FlowLogs CreateOrUpdate. */ +public final class FlowLogsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe") + .withEnabled(true) + .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1)) + .create(); + } +} 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..7d4efbf8b0c9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2c814241142dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0b0b1381c34a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e14b46e2d3850 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..e77d6738125bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesCreateOrUpdateSamples.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.HubRoute; +import java.util.Arrays; + +/** Samples for HubRouteTables CreateOrUpdate. */ +public final class HubRouteTablesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..18eab3c9875d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..4a09b7d863054 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3f3e09adf8f5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..57fc7f046760d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.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.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/2022-09-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..b7f4896d9c2ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsDeleteSamples.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 HubVirtualNetworkConnections Delete. */ +public final class HubVirtualNetworkConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c5da31ce3c1d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsGetSamples.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 HubVirtualNetworkConnections Get. */ +public final class HubVirtualNetworkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..80e05eddbf49f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for HubVirtualNetworkConnections List. */ +public final class HubVirtualNetworkConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..12706ccee4c67 --- /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/2022-09-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..23cdc9b822c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..45aead7645ad6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2ff2b076bdc73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f0350d5bac7cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationCreateOrUpdateSamples.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.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/2022-09-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") + .withRules( + Arrays + .asList( + new InboundSecurityRules() + .withProtocol(InboundSecurityRulesProtocol.TCP) + .withSourceAddressPrefix("50.20.121.5/32") + .withDestinationPortRange(22))) + .create(); + } +} 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..7100a5f1b746b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsCreateOrUpdateSamples.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.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/2022-09-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(); + } + + @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..446b121d29600 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..50dcfb9643fbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1bdafca5ee1e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for IpAllocations ListByResourceGroup. */ +public final class IpAllocationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0bb3b9c8e7635 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0fe43c1c1fa99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..2e5b49c225201 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsCreateOrUpdateSamples.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 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/2022-09-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", "value1")) + .withIpAddresses(Arrays.asList("13.64.39.16/32", "40.74.146.80/31", "40.74.147.32/28")) + .create(); + } + + @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..f4af95e9f21c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..197eb85cd5f2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1dce80ac5fc1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8f7d976f49aee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d5f8fb1af2b4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..5c0fe6f327b8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.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.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/2022-09-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..38f0770668517 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2bc4f7268c914 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.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 Get. */ +public final class LoadBalancerBackendAddressPoolsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..66ffe9c85f4e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.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; + +/** Samples for LoadBalancerBackendAddressPools List. */ +public final class LoadBalancerBackendAddressPoolsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..deb441c1f1c9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsGetSamples.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 LoadBalancerFrontendIpConfigurations Get. */ +public final class LoadBalancerFrontendIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..760713f2ec37c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for LoadBalancerFrontendIpConfigurations List. */ +public final class LoadBalancerFrontendIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e5735fc984b81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesGetSamples.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 LoadBalancerLoadBalancingRules Get. */ +public final class LoadBalancerLoadBalancingRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..37813c52b5121 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for LoadBalancerLoadBalancingRules List. */ +public final class LoadBalancerLoadBalancingRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e55b54c361017 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.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; + +/** Samples for LoadBalancerNetworkInterfaces List. */ +public final class LoadBalancerNetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..c266345885405 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..179f67d5e58a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for LoadBalancerOutboundRules List. */ +public final class LoadBalancerOutboundRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..10e0e347db1e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6746aba0925a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6e8200c34fc11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft 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.TransportProtocol; +import java.util.Arrays; + +/** Samples for LoadBalancers CreateOrUpdate. */ +public final class LoadBalancersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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.fromString("Premium"))) + .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/2022-09-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/2022-09-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/2022-09-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/2022-09-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.fromString("Premium"))) + .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/2022-09-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/2022-09-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/2022-09-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/2022-09-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..91f84a74a2042 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e78750b7ae313 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.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; + +/** Samples for LoadBalancers GetByResourceGroup. */ +public final class LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..516c79b4dbf22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for LoadBalancers ListByResourceGroup. */ +public final class LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..01160c7197239 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.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.QueryInboundNatRulePortMappingRequest; + +/** Samples for LoadBalancers ListInboundNatRulePortMappings. */ +public final class LoadBalancersListInboundNatRulePortMappingsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fc14bc3af16a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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/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..8a2bbcd392bee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.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 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/2022-09-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..8b7a10cb57de4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..e7d4923c009fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysCreateOrUpdateSamples.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.AddressSpace; +import java.util.Arrays; + +/** Samples for LocalNetworkGateways CreateOrUpdate. */ +public final class LocalNetworkGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1c492f2713bd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8adc59ce8a092 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2664b6a349922 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c429a784bb025 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..9dcf962b3645d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples.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.NetworkManagerConnectionInner; + +/** Samples for ManagementGroupNetworkManagerConnections CreateOrUpdate. */ +public final class ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fb8b52a350d5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsDeleteSamples.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 ManagementGroupNetworkManagerConnections Delete. */ +public final class ManagementGroupNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4f3592201e0a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsGetSamples.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 ManagementGroupNetworkManagerConnections Get. */ +public final class ManagementGroupNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..9aa0f0731deb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsListSamples.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 ManagementGroupNetworkManagerConnections List. */ +public final class ManagementGroupNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..28a9d9e611beb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysCreateOrUpdateSamples.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.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/2022-09-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..d0fd19fc6a318 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fe0e993727f9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..385f89ab1ba7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NatGateways ListByResourceGroup. */ +public final class NatGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..05d21b04f4743 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c71c29cd8f9b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..279033f4dc23e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesCreateOrUpdateSamples.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.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/2022-09-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..efe2eaf6a15c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1830f66cce7e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..bc55633f9d0cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1106eef89c980 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsCreateOrUpdateSamples.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 CreateOrUpdate. */ +public final class NetworkGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .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..cec5bb2bd0c74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..dcd3f5a1b0670 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3ad7a79ee7d0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..5e26b208718c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsGetSamples.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 NetworkInterfaceIpConfigurations Get. */ +public final class NetworkInterfaceIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..94d33c6e5155c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaceIpConfigurations List. */ +public final class NetworkInterfaceIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c93302076ed55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaceLoadBalancers List. */ +public final class NetworkInterfaceLoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ca070245d2bf6 --- /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/2022-09-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..7cc81f0021340 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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("rg1", "test-networkinterface", "test-tapconfiguration", 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..ada4cb58cb4f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.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 NetworkInterfaceTapConfigurations Get. */ +public final class NetworkInterfaceTapConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a7560465c5f46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaceTapConfigurations List. */ +public final class NetworkInterfaceTapConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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("rg1", "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..99f3bdabdcbe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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")))) + .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..343a1dd87a249 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fb5e7b4d34ea9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e3d129fecea65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.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 GetCloudServiceNetworkInterface. */ +public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..15c5bbf11df4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaces GetEffectiveRouteTable. */ +public final class NetworkInterfacesGetEffectiveRouteTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e92d7a725833f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.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 GetVirtualMachineScaleSetIpConfiguration. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ee921c922d7c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.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 GetVirtualMachineScaleSetNetworkInterface. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a2cb5a9838d89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaces ListByResourceGroup. */ +public final class NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e418d34aaf0d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f945df6973212 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.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 ListCloudServiceRoleInstanceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0d49655e66ce2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. */ +public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..72fdf29bf2c5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8142e9173fefc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.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 ListVirtualMachineScaleSetIpConfigurations. */ +public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ee049b7dcf239 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples.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 ListVirtualMachineScaleSetNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..47830163a0957 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples.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 ListVirtualMachineScaleSetVMNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4429be2effcd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..dbe62bf34dcf8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerCommitsPostSamples.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.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/2022-09-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..a40586ab04572 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerDeploymentStatusOperationListSamples.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.NetworkManagerDeploymentStatusParameter; +import java.util.Arrays; + +/** Samples for NetworkManagerDeploymentStatusOperation List. */ +public final class NetworkManagerDeploymentStatusOperationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/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..3bcd37627db3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersCreateOrUpdateSamples.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.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/2022-09-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..b51b9f23c48fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..bdf3eaf55d991 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..dc3772c5c735e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3b1e9ea15d4f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1dc83b377d6f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersPatchSamples.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.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/2022-09-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(); + } + + @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..a2115c8b5bb21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesCreateOrUpdateSamples.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.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/2022-09-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..ec17a5c15884d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e6d58e363533a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.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 NetworkProfiles GetByResourceGroup. */ +public final class NetworkProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..96d6ad1927e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkProfiles ListByResourceGroup. */ +public final class NetworkProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..25eede824957d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..cdce403532aef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..a34c1904d538b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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..ad63fe583eb06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b93464c0407e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b42ffbd6015eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkSecurityGroups ListByResourceGroup. */ +public final class NetworkSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6a4542d6570e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkSecurityGroups List. */ +public final class NetworkSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e4f42dde052ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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/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..594eba5eea475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +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 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/2022-09-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", "value1")) + .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/2022-09-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", "value1")) + .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) + .create(); + } + + @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..a295db96c552e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkVirtualAppliances Delete. */ +public final class NetworkVirtualAppliancesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bc1187d7aa8dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c13f14670cd63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkVirtualAppliances ListByResourceGroup. */ +public final class NetworkVirtualAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..89a3aed7d85c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for NetworkVirtualAppliances List. */ +public final class NetworkVirtualAppliancesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/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..a171e2d19abb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..a0e9c8b8d74ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.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.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/2022-09-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..cfac4fddd8a66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCreateOrUpdateSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..26a2b3f90e4a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..ac95ef75203bc --- /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/2022-09-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..1342163066e28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..35506d37d4dbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.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.FlowLogStatusParameters; + +/** Samples for NetworkWatchers GetFlowLogStatus. */ +public final class NetworkWatchersGetFlowLogStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7634bdd66bf90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.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.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/2022-09-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..e4dbd8f72c82a --- /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/2022-09-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..89b37297791e5 --- /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/2022-09-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..98414e1e7332c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.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.QueryTroubleshootingParameters; + +/** Samples for NetworkWatchers GetTroubleshootingResult. */ +public final class NetworkWatchersGetTroubleshootingResultSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c1a49a2830a60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.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.TroubleshootingParameters; + +/** Samples for NetworkWatchers GetTroubleshooting. */ +public final class NetworkWatchersGetTroubleshootingSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8469a2a4bcd18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.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.SecurityGroupViewParameters; + +/** Samples for NetworkWatchers GetVMSecurityRules. */ +public final class NetworkWatchersGetVMSecurityRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..797e69f6f1c26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.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.AvailableProvidersListParameters; +import java.util.Arrays; + +/** Samples for NetworkWatchers ListAvailableProviders. */ +public final class NetworkWatchersListAvailableProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8adb23bff450c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..ac5be871d0ba2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..020d16db9ad3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.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.FlowLogInformationInner; + +/** Samples for NetworkWatchers SetFlowLogConfiguration. */ +public final class NetworkWatchersSetFlowLogConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withEnabled(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/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..46685146f6421 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..94672201ebe0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.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.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/2022-09-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..643bb7250c8a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b60608af751a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .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(); + } + + @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..9067b8ade6ebc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..53c3040d08e2a --- /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/2022-09-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..cfd93ac5735fb --- /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/2022-09-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..19d0c9a2c0fa4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..946c801924847 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.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.P2SVpnConnectionHealthRequest; +import java.util.Arrays; + +/** Samples for P2SVpnGateways GetP2SVpnConnectionHealthDetailed. */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..cc4b57aa6ca39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for P2SVpnGateways GetP2SVpnConnectionHealth. */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6a6ca14e34c98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for P2SVpnGateways ListByResourceGroup. */ +public final class P2SVpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..51c29930c7032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for P2SVpnGateways List. */ +public final class P2SVpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f6dc9a5b4e5a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..a05fdd6960f41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..2620483e6fe42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.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.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/2022-09-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..be1f49095721e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b579f099e7666 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..9494894a64e13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6ed7655308d25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..af98567eaa800 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..66f84f2b27b94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.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 PeerExpressRouteCircuitConnections Get. */ +public final class PeerExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c6d9cd2e44d88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.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 PeerExpressRouteCircuitConnections List. */ +public final class PeerExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d1d6c8f8f6658 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.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.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/2022-09-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..b11482018b108 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6498475842498 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..21bf0c1c65709 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PrivateDnsZoneGroups List. */ +public final class PrivateDnsZoneGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f20f3ebc02a29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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/2022-09-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..9c6735726d55c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e7d13cfafeba8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.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 PrivateEndpoints GetByResourceGroup. */ +public final class PrivateEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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..439cb07b27329 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PrivateEndpoints ListByResourceGroup. */ +public final class PrivateEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4edd3c0421ce8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f00909a6874ea --- /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/2022-09-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..d9f1c247b9666 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.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.CheckPrivateLinkServiceVisibilityRequest; + +/** Samples for PrivateLinkServices CheckPrivateLinkServiceVisibility. */ +public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..220c9cf628ff3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCreateOrUpdateSamples.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.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/2022-09-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..7727f8c8bb8fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.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 DeletePrivateEndpointConnection. */ +public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a0e945d1a30b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..433b0ac01456e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..bc1cbb47ac714 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.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 GetPrivateEndpointConnection. */ +public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..73adb92090db2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.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 ListAutoApprovedPrivateLinkServicesByResourceGroup. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0ea616ad8c4f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples.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 ListAutoApprovedPrivateLinkServices. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..cc06820073a2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PrivateLinkServices ListByResourceGroup. */ +public final class PrivateLinkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..830b3421ea029 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListPrivateEndpointConnectionsSamples.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 ListPrivateEndpointConnections. */ +public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8fb2580a3e423 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..4ee3cd5577ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.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.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/2022-09-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..0e67605a1964d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesCreateOrUpdateSamples.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.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.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/2022-09-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/2022-09-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/2022-09-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(); + } +} 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..b4eb0f0bc9828 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDdosProtectionStatusSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PublicIpAddresses DdosProtectionStatus. */ +public final class PublicIpAddressesDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..934ab256c3c99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..cd88acb8d764a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b013601ee4ef7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.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 GetCloudServicePublicIpAddress. */ +public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..83c6b6ad07bab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.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 GetVirtualMachineScaleSetPublicIpAddress. */ +public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7d28d4052885c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PublicIpAddresses ListByResourceGroup. */ +public final class PublicIpAddressesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1b0c2767e70a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServicePublicIpAddressesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..faccff2082339 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.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 ListCloudServiceRoleInstancePublicIpAddresses. */ +public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bc6b06b25718a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..87267c08613eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2a8a0dc9c382e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.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 ListVirtualMachineScaleSetVMPublicIpAddresses. */ +public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3e6f5e9c11075 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..6054cabc63d3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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..7795d9360097f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..83ca1219a2aec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6fc9eee02d964 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for PublicIpPrefixes ListByResourceGroup. */ +public final class PublicIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..386d75c55d14b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6cf62ba9b7726 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..1c2dfbb2745d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..77c68ddff8de8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderCheckDnsNameAvailabilitySamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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/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..7be9ec711fbfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.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.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/2022-09-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..439ab11e8ddcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.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; + +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/2022-09-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..0a1994265032e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderExpressRouteProviderPortSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b3b0a797c9f0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.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.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/2022-09-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..d1c588c4d039b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ResourceProvider GetActiveSessions. */ +public final class ResourceProviderGetActiveSessionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b902f62daed39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.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.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/2022-09-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..53fe2a8eec0d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveConnectivityConfigurationsSamples.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.ActiveConfigurationParameter; +import java.util.Arrays; + +/** Samples for ResourceProvider ListActiveConnectivityConfigurations. */ +public final class ResourceProviderListActiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..86f4dd2017e44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveSecurityAdminRulesSamples.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.ActiveConfigurationParameter; +import java.util.Arrays; + +/** Samples for ResourceProvider ListActiveSecurityAdminRules. */ +public final class ResourceProviderListActiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2df0e35430f86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples.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.QueryRequestOptions; + +/** Samples for ResourceProvider ListNetworkManagerEffectiveConnectivityConfigurations. */ +public final class ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3c3289b36ed10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples.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.QueryRequestOptions; + +/** Samples for ResourceProvider ListNetworkManagerEffectiveSecurityAdminRules. */ +public final class ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d92352e29bd41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.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.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/2022-09-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..0345d7b71b0bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderSupportedSecurityProvidersSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e2eb08b19248d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.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.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/2022-09-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..9aed82ec88a5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..dffebb6c5b75f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..9a81ddcbceb48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for RouteFilterRules ListByRouteFilter. */ +public final class RouteFilterRulesListByRouteFilterSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ddb3bc2b17fe5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .withRules( + Arrays + .asList( + new RouteFilterRuleInner() + .withName("ruleName") + .withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")))) + .create(); + } + + @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..fa7c01a298393 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3940bdc088a77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d98c9485bb0f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for RouteFilters ListByResourceGroup. */ +public final class RouteFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ea1127a0a07f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..86175ecc2c06c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.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.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/2022-09-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", "value1")).apply(); + } + + @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..f96aeacbb06f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsCreateOrUpdateSamples.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.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/2022-09-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..335fb4ea7c991 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1a5d1ece67c45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f1d9abd07bca6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..a07600355ed59 --- /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/2022-09-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/2022-09-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..226f79cb39251 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..17b3e30b3afe5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..beb28755ae95d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for RouteTables ListByResourceGroup. */ +public final class RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a35539fbf4cb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8c8cd6ba2969c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..b64db02d7b368 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesCreateOrUpdateSamples.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.RouteNextHopType; + +/** Samples for Routes CreateOrUpdate. */ +public final class RoutesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2d85904f5edad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..914407f60c73f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0ea4618fef2a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d2caf147cc8e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentCreateOrUpdateSamples.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.RoutingPolicy; +import java.util.Arrays; + +/** Samples for RoutingIntent CreateOrUpdate. */ +public final class RoutingIntentCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..504082a9f939c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fa95020f9d94f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..162097e252352 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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/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..2a14fd6708f77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsCreateOrUpdateSamples.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 ScopeConnections CreateOrUpdate. */ +public final class ScopeConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..0cd8e5b6b90ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsDeleteSamples.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 ScopeConnections Delete. */ +public final class ScopeConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bfe212e4ada68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsGetSamples.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 ScopeConnections Get. */ +public final class ScopeConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..be294d7574203 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ScopeConnections List. */ +public final class ScopeConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..5a3ac62a53763 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsCreateOrUpdateSamples.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.NetworkIntentPolicyBasedService; +import java.util.Arrays; + +/** Samples for SecurityAdminConfigurations CreateOrUpdate. */ +public final class SecurityAdminConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..41972355c0cac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsDeleteSamples.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 SecurityAdminConfigurations Delete. */ +public final class SecurityAdminConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..34a2a549afcdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsGetSamples.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 SecurityAdminConfigurations Get. */ +public final class SecurityAdminConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b8866b20b6b9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsListSamples.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 SecurityAdminConfigurations List. */ +public final class SecurityAdminConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..22f3b2fa38ea8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .withSecurityProviderName(SecurityProviderName.ZSCALER) + .withVirtualHub( + new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .create(); + } + + @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..8e240567b3e97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityPartnerProviders Delete. */ +public final class SecurityPartnerProvidersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3256e2983ff7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3d17741589c0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityPartnerProviders ListByResourceGroup. */ +public final class SecurityPartnerProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..348e820e168a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityPartnerProviders List. */ +public final class SecurityPartnerProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..65323e568a438 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..46e86aed61ae8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesCreateOrUpdateSamples.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.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/2022-09-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..7d76873218cfc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityRules Delete. */ +public final class SecurityRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f6f62206b26c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityRules Get. */ +public final class SecurityRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..14bf4176cf0d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SecurityRules List. */ +public final class SecurityRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/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..d211b5134820b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e960c935bfc9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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..41e1cc9dbbe53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..15f7d382a7248 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..b6f48df67b7f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ServiceEndpointPolicies ListByResourceGroup. */ +public final class ServiceEndpointPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..deef447b25a14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for ServiceEndpointPolicies List. */ +public final class ServiceEndpointPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..21ec195cf1f2d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..76aa3ea584189 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples.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 java.util.Arrays; + +/** Samples for ServiceEndpointPolicyDefinitions CreateOrUpdate. */ +public final class ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..21498a2fa723c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsDeleteSamples.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 ServiceEndpointPolicyDefinitions Delete. */ +public final class ServiceEndpointPolicyDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fb5d611ba1698 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsGetSamples.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 ServiceEndpointPolicyDefinitions Get. */ +public final class ServiceEndpointPolicyDefinitionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3ea5828ad1a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsListByResourceGroupSamples.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 ServiceEndpointPolicyDefinitions ListByResourceGroup. */ +public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..5ea62bf4e4713 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.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; + +/** Samples for ServiceTagInformation List. */ +public final class ServiceTagInformationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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..34b012e8ec293 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3265d315ea808 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersCreateOrUpdateSamples.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 CreateOrUpdate. */ +public final class StaticMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..982b698841f8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersDeleteSamples.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 StaticMembers Delete. */ +public final class StaticMembersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2d005f56e5e7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersGetSamples.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 StaticMembers Get. */ +public final class StaticMembersGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2dd2f63499a3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..e46c3a02523ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsCreateOrUpdateSamples.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.generated; + +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/2022-09-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/2022-09-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/2022-09-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(); + } +} 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..f3b0a8e2e9607 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0294a20bdc7c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.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; + +/** Samples for Subnets Get. */ +public final class SubnetsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..51e9f300676a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..d13ce964f06b8 --- /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/2022-09-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..388ecf991b1d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.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.UnprepareNetworkPoliciesRequest; + +/** Samples for Subnets UnprepareNetworkPolicies. */ +public final class SubnetsUnprepareNetworkPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..09a6f5c2b4c9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples.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 SubscriptionNetworkManagerConnections CreateOrUpdate. */ +public final class SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1f33e7b8a8882 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsDeleteSamples.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 SubscriptionNetworkManagerConnections Delete. */ +public final class SubscriptionNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c435f328081c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsGetSamples.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 SubscriptionNetworkManagerConnections Get. */ +public final class SubscriptionNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6f786de6987ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for SubscriptionNetworkManagerConnections List. */ +public final class SubscriptionNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d8c4815ee41c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.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; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..71b33f612eb19 --- /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/2022-09-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..ae45be2901a1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..7f39f342ced78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..165111f44d0da --- /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/2022-09-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..c7f4dbb9a6b27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualApplianceSites Delete. */ +public final class VirtualApplianceSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..110d7c3485d12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualApplianceSites Get. */ +public final class VirtualApplianceSitesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2b3677cb29d75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualApplianceSites List. */ +public final class VirtualApplianceSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..29dff937db171 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualApplianceSkus Get. */ +public final class VirtualApplianceSkusGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ed83c58f0be85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualApplianceSkus List. */ +public final class VirtualApplianceSkusListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..dbdb22f0ccd5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsCreateOrUpdateSamples.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.core.management.SubResource; + +/** Samples for VirtualHubBgpConnections CreateOrUpdate. */ +public final class VirtualHubBgpConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2296b8b65b8a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualHubBgpConnections Delete. */ +public final class VirtualHubBgpConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..b1af36d203804 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualHubBgpConnections Get. */ +public final class VirtualHubBgpConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..119dcd9948278 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListAdvertisedRoutesSamples.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 VirtualHubBgpConnections ListAdvertisedRoutes. */ +public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..1adcd2e67bf01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListLearnedRoutesSamples.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 VirtualHubBgpConnections ListLearnedRoutes. */ +public final class VirtualHubBgpConnectionsListLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c0250376f12fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..436550adf9e0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationCreateOrUpdateSamples.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.SubnetInner; + +/** Samples for VirtualHubIpConfiguration CreateOrUpdate. */ +public final class VirtualHubIpConfigurationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bf637a8262a94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualHubIpConfiguration Delete. */ +public final class VirtualHubIpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2d915aea332fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationGetSamples.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 VirtualHubIpConfiguration Get. */ +public final class VirtualHubIpConfigurationGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..9fce164b7b775 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..6d58421455693 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.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.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/2022-09-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..2ba6bf6358d51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SDeleteSamples.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 VirtualHubRouteTableV2S Delete. */ +public final class VirtualHubRouteTableV2SDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fd439ad5d80b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SGetSamples.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 VirtualHubRouteTableV2S Get. */ +public final class VirtualHubRouteTableV2SGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..3693fceacfdf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..21f40cd4df295 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .withVirtualWan( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1")) + .withAddressPrefix("10.168.0.0/24") + .withSku("Basic") + .create(); + } + + @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..664ac314f2289 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0ad90a233227b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f9dc38b20dc7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.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.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/2022-09-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/2022-09-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/2022-09-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..930b41c6bbf18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetInboundRoutesSamples.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.GetInboundRoutesParameters; + +/** Samples for VirtualHubs GetInboundRoutes. */ +public final class VirtualHubsGetInboundRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ccb794b5c986d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetOutboundRoutesSamples.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.GetOutboundRoutesParameters; + +/** Samples for VirtualHubs GetOutboundRoutes. */ +public final class VirtualHubsGetOutboundRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..936e1317cd751 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualHubs ListByResourceGroup. */ +public final class VirtualHubsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ad756758a510f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1b78b06bfaa62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..16414d89112c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.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.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/2022-09-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(); + } + + @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..e21aae4a323d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGatewayConnections Delete. */ +public final class VirtualNetworkGatewayConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..610f563839a42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetByResourceGroupSamples.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 VirtualNetworkGatewayConnections GetByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f2b6db78cd287 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGatewayConnections GetIkeSas. */ +public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d4a19c27d23ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetSharedKeySamples.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 VirtualNetworkGatewayConnections GetSharedKey. */ +public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8e7faef1e3cae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGatewayConnections ListByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..22508b5faf0e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGatewayConnections ResetConnection. */ +public final class VirtualNetworkGatewayConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4604f8f78b046 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.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.fluent.models.ConnectionResetSharedKeyInner; + +/** Samples for VirtualNetworkGatewayConnections ResetSharedKey. */ +public final class VirtualNetworkGatewayConnectionsResetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fd06e1647bd7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.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.fluent.models.ConnectionSharedKeyInner; + +/** Samples for VirtualNetworkGatewayConnections SetSharedKey. */ +public final class VirtualNetworkGatewayConnectionsSetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..382f2867ef5a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.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.VpnPacketCaptureStartParameters; + +/** Samples for VirtualNetworkGatewayConnections StartPacketCapture. */ +public final class VirtualNetworkGatewayConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..39e18330126a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.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.VpnPacketCaptureStopParameters; + +/** Samples for VirtualNetworkGatewayConnections StopPacketCapture. */ +public final class VirtualNetworkGatewayConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..964d8f2b41770 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..46ced68aba81a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesCreateOrUpdateSamples.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.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/2022-09-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..59eb0f28f0ab4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGatewayNatRules Delete. */ +public final class VirtualNetworkGatewayNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..bbbc2768d6005 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesGetSamples.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 VirtualNetworkGatewayNatRules Get. */ +public final class VirtualNetworkGatewayNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..4b323fc3737f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples.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 VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. */ +public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..25ba9d6f60e28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.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.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/2022-09-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(); + } +} 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..a2c317c023ee2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0afa857893572 --- /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/2022-09-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..cecfed4802354 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.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; + +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/2022-09-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..7b91a88b988d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.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; + +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/2022-09-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..1547800aa9e54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways GetAdvertisedRoutes. */ +public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7b2bfb4848cdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways GetBgpPeerStatus. */ +public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..7079a1f330b5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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); + } +} 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..6ac4c2dbf1000 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways GetLearnedRoutes. */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2f37350b7eeda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. */ +public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d1a12850b8e94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples.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 GetVpnclientConnectionHealth. */ +public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8c19f5d98dc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. */ +public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8cb2146a40e3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkGateways ListByResourceGroup. */ +public final class VirtualNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e3ba648579477 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListConnectionsSamples.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 ListConnections. */ +public final class VirtualNetworkGatewaysListConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c66081c1a28a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..be29441531536 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..5280d01563471 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.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.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/2022-09-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..af08b8a6be57d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.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.VpnPacketCaptureStartParameters; + +/** Samples for VirtualNetworkGateways StartPacketCapture. */ +public final class VirtualNetworkGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..b89dd19aa699d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.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.VpnPacketCaptureStopParameters; + +/** Samples for VirtualNetworkGateways StopPacketCapture. */ +public final class VirtualNetworkGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..9c576093f7e34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSupportedVpnDevicesSamples.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 SupportedVpnDevices. */ +public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2159aa713bfb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..3124893925cf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.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.VpnDeviceScriptParameters; + +/** Samples for VirtualNetworkGateways VpnDeviceConfigurationScript. */ +public final class VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..e8718f27a57fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsCreateOrUpdateSamples.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; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; + +/** Samples for VirtualNetworkPeerings CreateOrUpdate. */ +public final class VirtualNetworkPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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(); + } +} 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..3801fb6c0bb4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c3689a3ba4cec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.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; + +/** Samples for VirtualNetworkPeerings Get. */ +public final class VirtualNetworkPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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); + } +} 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..645ea218faa96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.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; + +/** Samples for VirtualNetworkPeerings List. */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..971d825412714 --- /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/2022-09-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..c223b7006dc7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkTaps Delete. */ +public final class VirtualNetworkTapsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8e9092b7c7130 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8ac974e0a7c36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworkTaps ListByResourceGroup. */ +public final class VirtualNetworkTapsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..427effa297460 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..08a6ad8d8931c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..4266b5477506b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCheckIpAddressAvailabilitySamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..1d0ff0b03f299 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCreateOrUpdateSamples.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.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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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/2022-09-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..845cc9c3c4b8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8c157fb744055 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.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 VirtualNetworks GetByResourceGroup. */ +public final class VirtualNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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/2022-09-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..815395c7432d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualNetworks ListByResourceGroup. */ +public final class VirtualNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..f58ea63095e83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListDdosProtectionStatusSamples.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 ListDdosProtectionStatus. */ +public final class VirtualNetworksListDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..104ee666cceb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..eb3f997fad8d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..ce39ce067e705 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.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.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/2022-09-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(); + } + + @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..277b4793a5bc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsCreateOrUpdateSamples.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 VirtualRouterPeerings CreateOrUpdate. */ +public final class VirtualRouterPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..34acdade9aa45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c93a95267f8d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0768c481dd6ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualRouterPeerings List. */ +public final class VirtualRouterPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c7f78e4548620 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .withHostedGateway( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway")) + .create(); + } + + @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..7b9007295e8d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..68152b03e36ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f558f1e44473a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualRouters ListByResourceGroup. */ +public final class VirtualRoutersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..fe4f0cbe14e4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualRouters List. */ +public final class VirtualRoutersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..c7c194fccabe6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansCreateOrUpdateSamples.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 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/2022-09-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", "value1")) + .withDisableVpnEncryption(false) + .withTypePropertiesType("Basic") + .create(); + } + + @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..ade32d0a09e16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..0fab9165b48bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..45d28fee0d0f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VirtualWans ListByResourceGroup. */ +public final class VirtualWansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..5537131180e44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..7378dee46bc1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..c89a40b43e48c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.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.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/2022-09-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..9dafa939dd34b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..961e4d43f2446 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f1c6f5385722f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..c32b1d3cd7d90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.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.VpnConnectionPacketCaptureStartParameters; +import java.util.Arrays; + +/** Samples for VpnConnections StartPacketCapture. */ +public final class VpnConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..e81014ad9d6a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.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.VpnConnectionPacketCaptureStopParameters; +import java.util.Arrays; + +/** Samples for VpnConnections StopPacketCapture. */ +public final class VpnConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..17f6a073a1648 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .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(); + } + + @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..74b4e0d4072e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..cd9bd8c79f91a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..fcc1186f6c078 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VpnGateways ListByResourceGroup. */ +public final class VpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..8fe21ad3e5271 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VpnGateways List. */ +public final class VpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d9e280e948641 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..4360477022f73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.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.VpnGatewayPacketCaptureStartParameters; + +/** Samples for VpnGateways StartPacketCapture. */ +public final class VpnGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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/2022-09-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..6eeb32ced3be2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.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.VpnGatewayPacketCaptureStopParameters; + +/** Samples for VpnGateways StopPacketCapture. */ +public final class VpnGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ef632931f840c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.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.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/2022-09-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(); + } + + @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/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..6edba0cf967e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetIkeSasSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..2c1e03731b84e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListByVpnConnectionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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/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..ab26870a4d9f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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/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..f3a605eff4afd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsAssociatedWithVirtualWanListSamples.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 VpnServerConfigurationsAssociatedWithVirtualWan List. */ +public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..2bb7f707eedf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .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(); + } + + @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..8ae4e0c34f3d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VpnServerConfigurations Delete. */ +public final class VpnServerConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..88077630b08ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..46ae337ea7683 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for VpnServerConfigurations ListByResourceGroup. */ +public final class VpnServerConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..41f72958e5eca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..8c35b9b5a77db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..34cc5e8747eac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..34663da07470a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..3f9a86975ed26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..f066bf7d188e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.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.GetVpnSitesConfigurationRequest; +import java.util.Arrays; + +/** Samples for VpnSitesConfiguration Download. */ +public final class VpnSitesConfigurationDownloadSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..a26b9a61ceb51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesCreateOrUpdateSamples.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.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/2022-09-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", "value1")) + .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(); + } + + @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..c1f3b327550cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..370fb974324a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..34521d412368f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..24f8560289715 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..42c2e47e0fa8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.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.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/2022-09-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", "value1", "key2", "value2")).apply(); + } + + @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..6d731639c9e72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ActionType; +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.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.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 java.util.Arrays; + +/** Samples for WebApplicationFirewallPolicies CreateOrUpdate. */ +public final class WebApplicationFirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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") + .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))) + .withManagedRules( + new ManagedRulesDefinition() + .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)))))))) + .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..21735d91d93e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for WebApplicationFirewallPolicies Delete. */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..6e0e109cf63de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesGetByResourceGroupSamples.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 WebApplicationFirewallPolicies GetByResourceGroup. */ +public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..ae6b5b0cca39a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for WebApplicationFirewallPolicies ListByResourceGroup. */ +public final class WebApplicationFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..d18e1bfdf14ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for WebApplicationFirewallPolicies List. */ +public final class WebApplicationFirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..633f15748ae34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All 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/2022-09-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..a53a1848c6c30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** Samples for WebCategories List. */ +public final class WebCategoriesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2022-09-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..984eb60b7521f --- /dev/null +++ b/sdk/network/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/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 + EnableBatchRelease: true + 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 + +